mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] do a check to make sure the server exists before we try and emit
This commit is contained in:
parent
232258b6ec
commit
10a294af4d
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user