Skip to content

Commit

Permalink
[fix] do a check to make sure the server exists before we try and emit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Sep 30, 2014
1 parent 232258b commit 10a294a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/http-proxy/passes/ws-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ var passes = exports;
return i + ": " + proxyRes.headers[i];
}).join('\r\n') + '\r\n\r\n');
proxySocket.pipe(socket).pipe(proxySocket);
server.emit('proxySocket', proxySocket);
// Make sure server exists before we try to emit
server && server.emit('proxySocket', proxySocket);
});

return proxyReq.end(); // XXX: CHECK IF THIS IS THIS CORRECT
Expand Down

0 comments on commit 10a294a

Please sign in to comment.