mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Merge pull request #536 from nodejitsu/caronte-api
export the proxy itself from the main require
This commit is contained in:
commit
c17b591b7d
@ -1,8 +1,12 @@
|
||||
var http = require('http'),
|
||||
https = require('https'),
|
||||
url = require('url'),
|
||||
httpProxy = require('./http-proxy/'),
|
||||
proxy = exports;
|
||||
httpProxy = require('./http-proxy/');
|
||||
|
||||
/**
|
||||
* Export the the proxy "Server" as the main export
|
||||
*/
|
||||
module.exports = httpProxy.Server;
|
||||
|
||||
/**
|
||||
* Creates the proxy server.
|
||||
@ -19,23 +23,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 : <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()>
|
||||
*
|
||||
* {
|
||||
* 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>
|
||||
* xfwd : <true/false, adds x-forward headers>
|
||||
* secure : <true/false, verify SSL certificate>
|
||||
* }
|
||||
*
|
||||
* 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
|
||||
* }
|
||||
*/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user