Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
backport http-party#1552
Browse files Browse the repository at this point in the history
  • Loading branch information
roderik committed Nov 25, 2021
1 parent ecd771e commit 0f23930
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/http-proxy/passes/ws-incoming.js
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 !== "closed") {
socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers));
res.pipe(socket);
}
Expand Down

0 comments on commit 0f23930

Please sign in to comment.