Skip to content

Commit 8673fe9

Browse files
support falsy value for httpAgent and httpsAgent options
1 parent 1474eea commit 8673fe9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/proxy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Proxy.prototype.listen = function(options, callback) {
4949
this.httpPort = options.port || 8080;
5050
this.timeout = options.timeout || 0;
5151
this.keepAlive = !!options.keepAlive;
52-
this.httpAgent = options.httpAgent || new http.Agent({ keepAlive: this.keepAlive });
53-
this.httpsAgent = options.httpsAgent || new https.Agent({ keepAlive: this.keepAlive });
52+
this.httpAgent = typeof(options.httpAgent) !== "undefined" ? options.httpAgent : new http.Agent({ keepAlive: this.keepAlive });
53+
this.httpsAgent = typeof(options.httpsAgent) !== "undefined" ? options.httpsAgent : new https.Agent({ keepAlive: this.keepAlive });
5454
this.forceSNI = !!options.forceSNI;
5555
if (this.forceSNI && !this.silent) {
5656
console.log('SNI enabled. Clients not supporting SNI may fail');

0 commit comments

Comments
 (0)