From 182c76cd2322d4d4c041c2a964d51db396c5c96b Mon Sep 17 00:00:00 2001 From: Jarrett Cruger Date: Fri, 27 Dec 2013 19:01:28 -0500 Subject: [PATCH 1/2] [api] export the httpProxy.Server as the main export but preserve the createServer factory --- lib/http-proxy.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/http-proxy.js b/lib/http-proxy.js index 36589b39f..f59aca8b4 100644 --- a/lib/http-proxy.js +++ b/lib/http-proxy.js @@ -1,8 +1,14 @@ var http = require('http'), https = require('https'), url = require('url'), - httpProxy = require('./http-proxy/'), - proxy = exports; + httpProxy = require('./http-proxy/'); + +/** + * Export the "Server" so we can have an intuitive api for just creating + * a proxy + * + */ +module.exports = httpProxy.Server; /** * Creates the proxy server. @@ -19,23 +25,23 @@ var http = require('http'), * @api public */ -proxy.createProxyServer = proxy.createServer = function createProxyServer(options) { +module.exports.createProxyServer = module.exports.createServer = function createProxyServer(options) { /* * `options` is needed and it must have the following layout: - * - * { - * target : - * forward: - * agent : - * ssl : + * + * { + * target : + * forward: + * agent : + * ssl : * ws : - * xfwd : + * xfwd : * secure : - * } - * - * NOTE: `options.ws` and `options.ssl` are optional. - * `options.target and `options.forward` cannot be - * both missing + * } + * + * NOTE: `options.ws` and `options.ssl` are optional. + * `options.target and `options.forward` cannot be + * both missing * } */ From 6fa23e11f6dc0b9c09766b268611ade919bfaa08 Mon Sep 17 00:00:00 2001 From: Jarrett Cruger Date: Fri, 27 Dec 2013 19:04:44 -0500 Subject: [PATCH 2/2] [fix] comments --- lib/http-proxy.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/http-proxy.js b/lib/http-proxy.js index f59aca8b4..196dded44 100644 --- a/lib/http-proxy.js +++ b/lib/http-proxy.js @@ -4,9 +4,7 @@ var http = require('http'), httpProxy = require('./http-proxy/'); /** - * Export the "Server" so we can have an intuitive api for just creating - * a proxy - * + * Export the the proxy "Server" as the main export */ module.exports = httpProxy.Server;