diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js index 7861503..c02735b 100644 --- a/lib/http-proxy/index.js +++ b/lib/http-proxy/index.js @@ -6,7 +6,7 @@ var httpProxy = exports, https = require('https'), web = require('./passes/web-incoming'), ws = require('./passes/ws-incoming'); - + httpProxy.Server = ProxyServer; /** @@ -33,7 +33,7 @@ function createRightProxy(type) { cntr = args.length - 1, head, cbl; - /* optional args parse begin */ + /* optional args parse begin */ if(typeof args[cntr] === 'function') { cbl = args[cntr]; @@ -64,7 +64,7 @@ function createRightProxy(type) { }); - for(var i=0; i < passes.length; i++) { + for(var i=0; i < passes.length; i++) { /** * Call of passes functions * pass(req, res, options, head) @@ -73,7 +73,7 @@ function createRightProxy(type) { * refer to the connection socket * pass(req, socket, options, head) */ - if(passes[i](req, res, this.options, head, cbl ? false : this, cbl)) { // passes can return a truthy value to halt the loop + if(passes[i](req, res, options, head, cbl ? false : this, cbl)) { // passes can return a truthy value to halt the loop break; } } @@ -103,9 +103,9 @@ require('util').inherits(ProxyServer, EE3); ProxyServer.prototype.listen = function(port) { var self = this, closure = function(req, res) { self.web(req, res); }; - - this._server = this.options.ssl ? - https.createServer(this.options.ssl, closure) : + + this._server = this.options.ssl ? + https.createServer(this.options.ssl, closure) : http.createServer(closure); if(this.options.ws) { @@ -119,7 +119,7 @@ ProxyServer.prototype.listen = function(port) { ProxyServer.prototype.before = function(passName, callback) { var i = false; - this.passes.forEach(function(v, idx) { + this.passes.forEach(function(v, idx) { if(v.name === passName) i = idx; }) @@ -129,7 +129,7 @@ ProxyServer.prototype.before = function(passName, callback) { }; ProxyServer.prototype.after = function(passName, callback) { var i = false; - this.passes.forEach(function(v, idx) { + this.passes.forEach(function(v, idx) { if(v.name === passName) i = idx; })