mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[websockets] add latest websockets support
This commit is contained in:
parent
6c6fec094e
commit
45ef87e71b
@ -393,7 +393,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
|
||||
//
|
||||
// Setup the incoming client socket.
|
||||
//
|
||||
_socket(socket);
|
||||
_socket(socket, true);
|
||||
|
||||
//
|
||||
// On `upgrade` from the Agent socket, listen to
|
||||
@ -663,7 +663,12 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
|
||||
// request. This is small, and there's only ever one of
|
||||
// it; no need for pause/resume.
|
||||
//
|
||||
// XXX This is very wrong and should be fixed in node's core
|
||||
//
|
||||
reverseProxy.write(head);
|
||||
if (head && head.length === 0) {
|
||||
reverseProxy._send('');
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
return proxyError(ex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user