https-proxied
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,6 +0,8 @@ | ||
var tls = require('tls'); | ||
var net = require('net'); | ||
var crypto = require('crypto'); | ||
var http = require('http'); | ||
var inherits = require('util').inherits; | ||
var tls = require('tls'), | ||
net = require('net'), | ||
url = require('url'), | ||
qs = require('querystring'), | ||
crypto = require('crypto'), | ||
http = require('http'), | ||
inherits = require('util').inherits; | ||
@@ -87,4 +89,6 @@ var agents = {}; | ||
if (proxy.login) { | ||
connectHeaders['Proxy-Authorization'] = 'Basic ' + new Buffer(proxy.login).toString('base64'); | ||
if (typeof proxy == 'string') proxy = url.parse(proxy); | ||
if (proxy.auth) { | ||
connectHeaders['Proxy-Authorization'] = 'Basic ' + new Buffer(proxy.auth.split(':').map(function(i){ return qs.unescape(i)}).join(':'), 'ascii').toString('base64'); | ||
} | ||
@@ -94,3 +98,3 @@ | ||
var socket = net.createConnection(proxy.port || 3128, proxy.host || '127.0.0.1'); | ||
var socket = net.createConnection(proxy.port || 3128, proxy.hostname || '127.0.0.1'); | ||
var parser = parsers.alloc(parser); | ||
@@ -97,0 +101,0 @@ parser.reinitialize('response'); |
{ | ||
"name": "https-proxied", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A https client that works with SSL proxies", | ||
@@ -5,0 +5,0 @@ "engines": { "node": ">=0.4.0" }, |
@@ -10,7 +10,3 @@ Example | ||
path: '/', | ||
proxy: { | ||
host: 'my-proxy-server.com', | ||
port: 3128, | ||
login: 'proxyuser:proxypass' | ||
} | ||
proxy: 'http://user:pass@my-proxy-server.com:3128' | ||
}; | ||
@@ -17,0 +13,0 @@ |
@@ -34,7 +34,3 @@ var vows = require('vows'), | ||
path: '/', | ||
proxy: { | ||
host: 'localhost', | ||
port: 9817, | ||
login: 'user:pass' | ||
} | ||
proxy: 'http://user:pass@localhost:9817' | ||
}; | ||
@@ -41,0 +37,0 @@ var req = https.get(options, function(res) { |
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
13785
192
16