Tunnel #199

Merged
merged 2 commits into from Mar 1, 2012

Projects

None yet

3 participants

@isaacs
Contributor
isaacs commented Mar 1, 2012

Tunnel

@mikeal mikeal merged commit 2664bfa into request:master Mar 1, 2012
@polotek polotek commented on the diff Mar 2, 2012
@@ -133,6 +134,20 @@ Request.prototype.init = function (options) {
}
if (self.proxy) {
if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy)
+
+ // do the HTTP CONNECT dance using koichik/node-tunnel
+ if (http.globalAgent && self.uri.protocol === "https:") {
+ self.tunnel = true
+ var tunnelFn = self.proxy.protocol === "http:"
+ ? tunnel.httpsOverHttp : tunnel.httpsOverHttps
+
+ var tunnelOptions = { proxy: { host: self.proxy.hostname
+ , port: +self.proxy.port }
+ , ca: this.ca }
+
+ self.agent = tunnelFn(tunnelOptions)
+ self.tunnel = true
@polotek
polotek Mar 2, 2012 Contributor

self.tunnel is already true

@koichik koichik referenced this pull request in koichik/node-tunnel Mar 2, 2012
Closed

get this in to request #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment