Skip to content

Commit df729db

Browse files
committed
fix(handlers.js): server crash when target ws server closes.
1 parent d185278 commit df729db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/handlers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ module.exports = {
44

55
function proxyError (err, req, res) {
66
var host = (req.headers && req.headers.host);
7-
if (!res.headersSent) {
7+
8+
if (res.writeHead && !res.headersSent) {
89
res.writeHead(500);
910
}
11+
1012
res.end('Error occured while trying to proxy to: '+ host + req.url);
1113
};

0 commit comments

Comments
 (0)