Skip to content

Commit

Permalink
fix: port http-party#1552
Browse files Browse the repository at this point in the history
  • Loading branch information
BerndSchrooten committed Jun 8, 2022
1 parent 6293b3f commit f7eac75
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 && !socket.destroyed) {
if (!res.upgrade && socket.readyState !== "closed") {
try {
socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers));
res.pipe(socket);
Expand Down

0 comments on commit f7eac75

Please sign in to comment.