Skip to content
Permalink
Browse files

[fix] closes number #487

  • Loading branch information...
yawnt committed Nov 7, 2013
1 parent 590bb60 commit cde08fb2ee2df03c9457678d8e6776a5d89165b2
Showing with 17 additions and 18 deletions.
  1. +17 −18 lib/http-proxy.js
@@ -20,24 +20,23 @@ var http = require('http'),
*/

proxy.createProxyServer = proxy.createServer = function createProxyServer(options) {
if(!options) {
throw new Error([
"`options` is needed and it must have the following layout:",
" ",
" { ",
" target : <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> ",
" ssl : <object to be passed to https.createServer()> ",
" ws : <true/false, if you want to proxy websockets> ",
" xfwd : <true/false, adds x-forward headers> ",
" } ",
" ",
"NOTE: `options.ws` and `options.ssl` are optional. ",
" `options.target and `options.forward` cannot be ",
" both missing "
].join("\n"));
}
/*
* `options` is needed and it must have the following layout:
*
* {
* target : <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>
* ssl : <object to be passed to https.createServer()>
* ws : <true/false, if you want to proxy websockets>
* xfwd : <true/false, adds x-forward headers>
* }
*
* NOTE: `options.ws` and `options.ssl` are optional.
* `options.target and `options.forward` cannot be
* both missing
* }
*/

return new httpProxy.Server(options);
};

0 comments on commit cde08fb

Please sign in to comment.
You can’t perform that action at this time.