Skip to content

Commit

Permalink
fix(http-party#1342): pipe-writing for opening-socket
Browse files Browse the repository at this point in the history
  • Loading branch information
caosm committed Jan 2, 2020
1 parent 9bbe486 commit 46d02be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/http-proxy/passes/ws-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module.exports = {
proxyReq.on('error', onOutgoingError);
proxyReq.on('response', function (res) {
// if upgrade event isn't going to happen, close the socket
if (!res.upgrade) {
if (!res.upgrade && socket.readyState === socket.OPEN) {
socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers));
res.pipe(socket);
}
Expand Down

0 comments on commit 46d02be

Please sign in to comment.