dispatch-proxy
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -33,3 +33,3 @@ var Dispatcher, HttpDispatcher, http, url, | ||
options.agent = agent; | ||
serverRequest = _this.createRequest(options); | ||
serverRequest = http.request(options); | ||
clientRequest.pipe(serverRequest); | ||
@@ -53,8 +53,4 @@ serverRequest.on('response', function(serverResponse) { | ||
HttpDispatcher.prototype.createRequest = function(options) { | ||
return http.request(options); | ||
}; | ||
return HttpDispatcher; | ||
})(Dispatcher); |
@@ -1,2 +0,2 @@ | ||
var Dispatcher, SocksDispatcher, colog, dns, net, socks, | ||
var Dispatcher, SocksDispatcher, colog, net, socks, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -13,4 +13,2 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
dns = require('dns'); | ||
module.exports = SocksDispatcher = (function(_super) { | ||
@@ -38,2 +36,3 @@ __extends(SocksDispatcher, _super); | ||
}).on('error', function(err) { | ||
clientConnection.end(); | ||
return _this.emit('error', { | ||
@@ -40,0 +39,0 @@ type: 'serverConnection', |
@@ -45,3 +45,3 @@ var HttpDispatcher, SocksDispatcher, colog, os, print, program, | ||
program.command('start').usage('[options] [addresses]').description('start a proxy server').option('-H, --host <h>', 'which host to accept connections from (defaults to localhost)', String).option('-p, --port <p>', 'which port to listen to for connections (defaults to 55667)', Number).option('--http', 'start an http proxy server', Boolean).action(function() { | ||
program.command('start').usage('[options] [addresses]').description('start a proxy server').option('-H, --host <h>', 'which host to accept connections from (defaults to localhost)', String).option('-p, --port <p>', 'which port to listen to for connections (defaults to 8080 for HTTP proxy, 1080 for SOCKS proxy)', Number).option('--http', 'start an http proxy server', Boolean).action(function() { | ||
var addr, address, addresses, addrs, arg, args, dispatcher, host, http, https, name, port, priority, type, _arg, _i, _j, _k, _len, _len1, _ref, _ref1; | ||
@@ -76,8 +76,9 @@ args = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), _arg = arguments[_i++]; | ||
} | ||
port || (port = 55667); | ||
host || (host = 'localhost'); | ||
if (http) { | ||
port || (port = 8080); | ||
type = 'HTTP'; | ||
dispatcher = new HttpDispatcher(addresses, port, host); | ||
} else { | ||
port || (port = 1080); | ||
type = 'SOCKS5'; | ||
@@ -84,0 +85,0 @@ dispatcher = new SocksDispatcher(addresses, port, host); |
@@ -5,3 +5,3 @@ { | ||
"author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -20,3 +20,3 @@ dispatch-proxy | ||
``` | ||
Start a SOCKS proxy server on `localhost:55667`. Simply add this address as a SOCKS proxy in your system settings and your traffic will be automatically balanced between all available internet connections. | ||
Start a SOCKS proxy server on `localhost:1080`. Simply add this address as a SOCKS proxy in your system settings and your traffic will be automatically balanced between all available internet connections. | ||
Usage | ||
@@ -48,3 +48,3 @@ ----- | ||
-H, --host <h> which host to accept connections from (defaults to localhost) | ||
-p, --port <p> which port to listen to for connections (defaults to 55667) | ||
-p, --port <p> which port to listen to for connections (defaults to 8080 for HTTP proxy, 1080 for SOCKS proxy) | ||
--http start an http proxy server | ||
@@ -57,3 +57,3 @@ ``` | ||
``` | ||
Start an HTTP proxy server listening on port `55667`, dispatching connections to every non-internal IPv4 local addresses. | ||
Start an HTTP proxy server listening on `localhost:8080`, dispatching connections to every non-internal IPv4 local addresses. | ||
``` | ||
@@ -60,0 +60,0 @@ $ dispatch start 10.0.0.0 10.0.0.1 |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
4
22658
502