socks-proxy-agent
Advanced tools
Comparing version 3.0.1 to 4.0.0
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17530
8
+ Addedagent-base@4.1.2(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.1.6(transitive)
- Removedagent-base@4.3.0(transitive)
- Removedsmart-buffer@1.1.15(transitive)
- Removedsocks@1.1.10(transitive)
Updatedagent-base@~4.1.0
Updatedsocks@~2.1.6