socks-proxy-agent
Advanced tools
Comparing version
13
index.js
@@ -9,3 +9,3 @@ /** | ||
var Agent = require('agent-base'); | ||
var SocksClient = require('socks'); | ||
var SocksClient = require('socks').SocksClient; | ||
var inherits = require('util').inherits; | ||
@@ -94,3 +94,5 @@ | ||
// called once the SOCKS proxy has connected to the specified remote endpoint | ||
function onhostconnect(err, socket) { | ||
function onhostconnect(err, result) { | ||
var socket = result.socket | ||
if (err) return fn(err); | ||
@@ -109,3 +111,3 @@ var s = socket; | ||
} | ||
socket.resume(); | ||
fn(null, s); | ||
@@ -117,3 +119,3 @@ } | ||
if (err) return fn(err); | ||
options.target.host = ip; | ||
options.destination.host = ip; | ||
SocksClient.createConnection(options, onhostconnect); | ||
@@ -128,3 +130,3 @@ } | ||
}, | ||
target: { | ||
destination: { | ||
port: +opts.port | ||
@@ -134,2 +136,3 @@ }, | ||
}; | ||
if (proxy.authentication) { | ||
@@ -136,0 +139,0 @@ options.proxy.authentication = proxy.authentication; |
{ | ||
"name": "socks-proxy-agent", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", | ||
@@ -28,10 +28,13 @@ "main": "./index.js", | ||
"dependencies": { | ||
"agent-base": "^4.1.0", | ||
"socks": "^1.1.10" | ||
"agent-base": "~4.1.0", | ||
"socks": "~2.1.6" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^3.4.2", | ||
"raw-body": "^2.2.0", | ||
"mocha": "~3.4.2", | ||
"raw-body": "~2.2.0", | ||
"socksv5": "0.0.6" | ||
}, | ||
"engines": { | ||
"node": ">= 6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
17530
0.29%8
-11.11%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated