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

proxy

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

6

History.md

@@ -0,1 +1,7 @@

0.2.0 / 2013-09-10
==================
- Fix calling the setup() function without any arguments
- Initial integration of "commander" for the `proxy(1)` program
0.1.0 / 2013-09-09

@@ -2,0 +8,0 @@ ==================

7

package.json
{
"name": "proxy",
"version": "0.1.0",
"version": "0.2.0",
"description": "An HTTP proxy written with Node.js (think Squid)",

@@ -17,2 +17,6 @@ "main": "proxy.js",

"squid",
"privoxy",
"apache",
"mod_proxy",
"via",
"x-forwarded-for"

@@ -28,2 +32,3 @@ ],

"basic-auth-parser": "0.0.2",
"commander": "2.0.0",
"debug": "0.7.2"

@@ -30,0 +35,0 @@ },

5

proxy.js

@@ -41,3 +41,3 @@

function setup (server, options) {
if (!server) http.createServer();
if (!server) server = http.createServer();
server.on('request', onrequest);

@@ -386,3 +386,4 @@ server.on('connect', onconnect);

function authenticate (server, req, fn) {
if ('function' == typeof server.authenticate) {
var hasAuthenticate = 'function' == typeof server.authenticate;
if (hasAuthenticate) {
debug.request('authenticating request "%s %s"', req.method, req.url);

@@ -389,0 +390,0 @@ server.authenticate(req, fn);

@@ -19,2 +19,3 @@ proxy

* [Apache][] with [`mod_proxy`][mod_proxy]
* [More…](http://wikipedia.org/wiki/Proxy_server#Web_proxy_servers)

@@ -31,4 +32,4 @@

If you would like to have the `proxy(1)` CLI program in your $PATH, then install
"globally":
If you would like to have the `proxy(1)` CLI program in your `$PATH`, then
install "globally":

@@ -60,2 +61,40 @@ ``` bash

CLI Tool Examples
-----------------
The `proxy(1)` CLI tool can be used to spawn HTTP(s) proxy server instances with
various options.
#### Port to bind to
Pass the `-p`/`--port` option to with a port number to specify a TCP port to
bind to. Defaults to __3128__ if none is specified.
``` bash
$ proxy --port 8080
```
#### Custom `Proxy-Authenticate` command
Pass the `-a`/`--authenticate` switch with a command to execute when the client
`Proxy-Authorization` header is given. This command determines whether or not the
request is authorized based on the "exit code" of the command.
The relevant request authentication information is passed in as
`PROXY_AUTH_USERNAME`, `PROXY_AUTH_PASSWORD` and `PROXY_AUTH_SCHEME` environment
variables.
For example, to authorize "Basic" authentication with username "foo" and
password "bar":
``` bash
$ proxy --authenticate 'if \
[ "$PROXY_AUTH_USERNAME" = "foo" ] && \
[ "$PROXY_AUTH_PASSWORD" = "bar" ]; \
then exit 0; \
fi; \
exit 1;'
```
License

@@ -62,0 +101,0 @@ -------

Sorry, the diff of this file is not supported yet

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