Skip to content

Commit cde08fb

Browse files
committed
[fix] closes number #487
1 parent 590bb60 commit cde08fb

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

lib/http-proxy.js

+17-18
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,23 @@ var http = require('http'),
2020
*/
2121

2222
proxy.createProxyServer = proxy.createServer = function createProxyServer(options) {
23-
if(!options) {
24-
throw new Error([
25-
"`options` is needed and it must have the following layout:",
26-
" ",
27-
" { ",
28-
" target : <url string to be parsed with the url module> ",
29-
" forward: <url string to be parsed with the url module> ",
30-
" agent : <object to be passed to http(s).request> ",
31-
" ssl : <object to be passed to https.createServer()> ",
32-
" ws : <true/false, if you want to proxy websockets> ",
33-
" xfwd : <true/false, adds x-forward headers> ",
34-
" } ",
35-
" ",
36-
"NOTE: `options.ws` and `options.ssl` are optional. ",
37-
" `options.target and `options.forward` cannot be ",
38-
" both missing "
39-
].join("\n"));
40-
}
23+
/*
24+
* `options` is needed and it must have the following layout:
25+
*
26+
* {
27+
* target : <url string to be parsed with the url module>
28+
* forward: <url string to be parsed with the url module>
29+
* agent : <object to be passed to http(s).request>
30+
* ssl : <object to be passed to https.createServer()>
31+
* ws : <true/false, if you want to proxy websockets>
32+
* xfwd : <true/false, adds x-forward headers>
33+
* }
34+
*
35+
* NOTE: `options.ws` and `options.ssl` are optional.
36+
* `options.target and `options.forward` cannot be
37+
* both missing
38+
* }
39+
*/
4140

4241
return new httpProxy.Server(options);
4342
};

0 commit comments

Comments
 (0)