mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] closes number #487
This commit is contained in:
parent
590bb604da
commit
cde08fb2ee
@ -20,24 +20,23 @@ var http = require('http'),
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
proxy.createProxyServer = proxy.createServer = function createProxyServer(options) {
|
proxy.createProxyServer = proxy.createServer = function createProxyServer(options) {
|
||||||
if(!options) {
|
/*
|
||||||
throw new Error([
|
* `options` is needed and it must have the following layout:
|
||||||
"`options` is needed and it must have the following layout:",
|
*
|
||||||
" ",
|
* {
|
||||||
" { ",
|
* target : <url string to be parsed with the url module>
|
||||||
" target : <url string to be parsed with the url module> ",
|
* forward: <url string to be parsed with the url module>
|
||||||
" forward: <url string to be parsed with the url module> ",
|
* agent : <object to be passed to http(s).request>
|
||||||
" agent : <object to be passed to http(s).request> ",
|
* ssl : <object to be passed to https.createServer()>
|
||||||
" ssl : <object to be passed to https.createServer()> ",
|
* ws : <true/false, if you want to proxy websockets>
|
||||||
" ws : <true/false, if you want to proxy websockets> ",
|
* xfwd : <true/false, adds x-forward headers>
|
||||||
" xfwd : <true/false, adds x-forward headers> ",
|
* }
|
||||||
" } ",
|
*
|
||||||
" ",
|
* NOTE: `options.ws` and `options.ssl` are optional.
|
||||||
"NOTE: `options.ws` and `options.ssl` are optional. ",
|
* `options.target and `options.forward` cannot be
|
||||||
" `options.target and `options.forward` cannot be ",
|
* both missing
|
||||||
" both missing "
|
* }
|
||||||
].join("\n"));
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
return new httpProxy.Server(options);
|
return new httpProxy.Server(options);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user