mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] make @mmalecki a happy camper
This commit is contained in:
parent
1993faf8a4
commit
c9cd6d2ad3
@ -51,6 +51,7 @@ proxy.createProxyServer = function createProxyServer(options) {
|
||||
options.ee = new events.EventEmitter2({ wildcard: true, delimiter: ':' });
|
||||
|
||||
return {
|
||||
ee : options.ee,
|
||||
web : caronte.createWebProxy(options),
|
||||
ws : caronte.createWsProxy(options),
|
||||
listen : function listen(port) {
|
||||
@ -63,9 +64,6 @@ proxy.createProxyServer = function createProxyServer(options) {
|
||||
server.listen(port);
|
||||
|
||||
return server;
|
||||
},
|
||||
emitter : function() {
|
||||
return options.ee;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -30,9 +30,12 @@ function createRightProxy(type) {
|
||||
return passes[pass];
|
||||
});
|
||||
|
||||
return function(req, res) {
|
||||
return function(req, res, opts) {
|
||||
var self = this,
|
||||
ev = 'caronte:' + type + ':';
|
||||
|
||||
if(typeof opts !== 'undefined') { options = opts; }
|
||||
|
||||
options.ee.emit(ev + 'begin', req, res);
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user