mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
commit
ebfdbede31
@ -437,6 +437,8 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.emit('websocket:start', req, socket, head, this.target);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Helper function for setting appropriate socket values:
|
// Helper function for setting appropriate socket values:
|
||||||
// 1. Turn of all bufferings
|
// 1. Turn of all bufferings
|
||||||
|
|||||||
@ -111,9 +111,17 @@ RoutingProxy.prototype.add = function (options) {
|
|||||||
this.proxies[key].on('webSocketProxyError', this.emit.bind(this, 'webSocketProxyError'));
|
this.proxies[key].on('webSocketProxyError', this.emit.bind(this, 'webSocketProxyError'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.proxies[key].on('start', this.emit.bind(this, 'start'));
|
[
|
||||||
this.proxies[key].on('forward', this.emit.bind(this, 'forward'));
|
'start',
|
||||||
this.proxies[key].on('end', this.emit.bind(this, 'end'));
|
'forward',
|
||||||
|
'end',
|
||||||
|
'websocket:start',
|
||||||
|
'websocket:end',
|
||||||
|
'websocket:incoming',
|
||||||
|
'websocket:outgoing'
|
||||||
|
].forEach(function(event) {
|
||||||
|
this.proxies[key].on(event, this.emit.bind(this, event));
|
||||||
|
}, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user