socks5-https-client
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -24,2 +24,4 @@ /** | ||
options.protocol = 'https:'; | ||
// Node v0.12.0 requires the port to be specified. | ||
@@ -26,0 +28,0 @@ if (!options.port) { |
@@ -13,3 +13,3 @@ /** | ||
var tls = require('tls'); | ||
var http = require('http'); | ||
var https = require('https'); | ||
var inherits = require('util').inherits; | ||
@@ -20,8 +20,8 @@ | ||
function createConnection(options) { | ||
var socksSocket, handleSocksConnectToHost; | ||
var socksSocket, onProxied; | ||
socksSocket = socksClient.createConnection(options); | ||
handleSocksConnectToHost = socksSocket.handleSocksConnectToHost; | ||
socksSocket.handleSocksConnectToHost = function() { | ||
onProxied = socksSocket.onProxied; | ||
socksSocket.onProxied = function() { | ||
options.socket = socksSocket.socket; | ||
@@ -34,3 +34,3 @@ options.servername = options.hostname || options.host; | ||
socksSocket.authorized = socksSocket.socket.authorized; | ||
handleSocksConnectToHost.call(socksSocket); | ||
onProxied.call(socksSocket); | ||
}); | ||
@@ -47,3 +47,3 @@ | ||
function Agent(options) { | ||
http.Agent.call(this, options); | ||
https.Agent.call(this, options); | ||
@@ -53,10 +53,7 @@ this.socksHost = options.socksHost || 'localhost'; | ||
this.defaultPort = 443; | ||
this.protocol = 'https:'; | ||
this.createConnection = createConnection; | ||
} | ||
inherits(Agent, http.Agent); | ||
inherits(Agent, https.Agent); | ||
module.exports = Agent; |
{ | ||
"name": "socks5-https-client", | ||
"description": "SOCKS v5 HTTPS client.", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"main": "index.js", | ||
@@ -23,6 +23,6 @@ "homepage": "https://github.com/mattcg/socks5-https-client", | ||
"dependencies": { | ||
"socks5-client": "~1.1.0" | ||
"socks5-client": "~1.2.3" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~2.5.3", | ||
"mocha": "~3.1.2", | ||
"node-socks": "~0.1.0", | ||
@@ -35,5 +35,5 @@ "request": "~2.72.0" | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
"node": ">= 6.4.0" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -24,2 +24,4 @@ # SOCKS5 HTTPS Client # | ||
Username and password authentication is supported with the `socksUsername` and `socksPassword` options. | ||
You may also pass a URL as the first argument to `get` or `request`, which will be parsed using `url.parse`. | ||
@@ -26,0 +28,0 @@ |
@@ -21,5 +21,2 @@ /** | ||
var version = process.version.substr(1).split('.'); | ||
var readableStreams = version[0] > 0 || version[1] > 8; | ||
suite('socks5-https-client tests', function() { | ||
@@ -66,6 +63,3 @@ var server; | ||
req = https.request({ | ||
hostname: 'encrypted.google.com', | ||
path: '/' | ||
}, function(res, err) { | ||
req = https.request('https://en.wikipedia.org/wiki/Main_Page', function(res, err) { | ||
var data = ''; | ||
@@ -77,17 +71,6 @@ | ||
res.setEncoding('utf8'); | ||
res.on('readable', function() { | ||
data += res.read(); | ||
}); | ||
if (readableStreams) { | ||
// The new way, using the readable stream interface (Node >= 0.10.0): | ||
res.on('readable', function() { | ||
data += res.read(); | ||
}); | ||
} else { | ||
// The old way, using 'data' listeners (Node <= 0.8.22): | ||
res.on('data', function(chunk) { | ||
data += chunk; | ||
}); | ||
} | ||
res.on('end', function() { | ||
@@ -94,0 +77,0 @@ assert(-1 !== data.indexOf('<html')); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
61
7938
185
+ Addedip-address@6.1.0(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedsocks5-client@1.2.8(transitive)
+ Addedsprintf-js@1.1.2(transitive)
- Removedasync@0.2.10(transitive)
- Removedcli@0.6.6(transitive)
- Removedcliff@0.1.10(transitive)
- Removedcolors@0.6.21.0.3(transitive)
- Removedcycle@1.0.3(transitive)
- Removedexit@0.1.2(transitive)
- Removedeyes@0.1.8(transitive)
- Removedglob@3.2.11(transitive)
- Removedinherits@2.0.4(transitive)
- Removedip-address@4.2.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.0.0(transitive)
- Removedlodash._arraycopy@3.0.0(transitive)
- Removedlodash._arrayeach@3.0.0(transitive)
- Removedlodash._basecallback@3.3.1(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._baseeach@3.0.4(transitive)
- Removedlodash._basefind@3.0.0(transitive)
- Removedlodash._basefindindex@3.6.0(transitive)
- Removedlodash._basefor@3.0.3(transitive)
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._createassigner@3.1.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash.find@3.2.1(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isplainobject@3.2.0(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.keysin@3.0.8(transitive)
- Removedlodash.merge@3.3.2(transitive)
- Removedlodash.pairs@3.0.1(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.toplainobject@3.0.0(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.3.0(transitive)
- Removedpkginfo@0.3.1(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedsocks5-client@1.1.2(transitive)
- Removedsprintf@0.1.5(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedwinston@0.8.3(transitive)
Updatedsocks5-client@~1.2.3