Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-proxi-cache

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxi-cache

A caching HTTP forward proxy.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-92.11%
Maintainers
0
Weekly downloads
 
Created
Source

http-proxy-cache

A caching HTTP forward proxy.

Build status

js-standard-style

Features:

  • 100% transparent
  • Keeps consistent header order similar to Google Chrome (see headerOrder in index.js)
  • Ensures all headers sent to the target is properly cased (e.g. User-Agent instead of user-agent)
  • Stores all 200 responses in a MongoDB database
  • Forwards all requests to the target by default (i.e. cache not used)
  • Prefers the content in the cache if the X-Cache-Preferred header is present (this header is never sent to the target)
  • If environment variable PROXY_AUTH is set, the proxy will reject all incoming requests that doesn't have a header X-Proxy-Auth with the same value

Prerequisites

  • MongoDB - Use the environment variable MONGO_URI to specify connection string (defaults to: localhost/http-proxy-cache)
  • Optional: Opbeat account for error logging configured using environment variables

Installation

npm install http-proxy-cache -g

Start

To start the proxy, simply run:

http-proxy-cache

Example usage

This is an example app that uses the request module to perform a HTTP request via the proxy to httpbin which will echo the HTTP request back as the reponse body:

var request = require('request')

request({
  uri: 'http://httpbin.org/get',
  proxy: 'http://<your-proxy-domain-here>'
}, function (err, res, body) {
  if (err) throw err
  console.log(body)
})

Debug

Set the environment variable DEBUG=proxy to enable debug mode.

License

MIT

Keywords

FAQs

Package last updated on 03 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc