mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] better code
This commit is contained in:
parent
5a1504f076
commit
3d8e5383cd
@ -39,6 +39,6 @@ proxy.createProxyServer = proxy.createServer = function createProxyServer(option
|
|||||||
].join("\n"));
|
].join("\n"));
|
||||||
} */
|
} */
|
||||||
|
|
||||||
return new ProxyServer(options, httpProxy.createWebProxy(options), httpProxy.createWsProxy(options));
|
return new ProxyServer(options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,7 @@ var httpProxy = exports,
|
|||||||
web = require('./passes/web-incoming'),
|
web = require('./passes/web-incoming'),
|
||||||
ws = require('./passes/ws-incoming');
|
ws = require('./passes/ws-incoming');
|
||||||
|
|
||||||
httpProxy.createWebProxy = createRightProxy('web');
|
httpProxy.Server = ProxyServer;
|
||||||
httpProxy.createWsProxy = createRightProxy('ws');
|
|
||||||
httpProxy.Server = ProxyServer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a function that creates the loader for
|
* Returns a function that creates the loader for
|
||||||
@ -89,11 +87,11 @@ function createRightProxy(type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ProxyServer(options, web, ws) {
|
function ProxyServer(options) {
|
||||||
EE3.call(this);
|
EE3.call(this);
|
||||||
|
|
||||||
this.web = web;
|
this.web = createRightProxy('web')(options);
|
||||||
this.ws = ws;
|
this.ws = reateRightProxy('ws')(options);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
||||||
this.passes = Object.keys(passes).map(function(pass) {
|
this.passes = Object.keys(passes).map(function(pass) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user