prepareRequestFunction() sometimes have request.socket.remoteAddress undefined
jancurn opened this issue · comments
When the client connection is closed too early, the request
object passed to prepareRequestFunction()
has socket.remoteAddress
undefined, which can cause issues to users to the proxy-chain package. Since such connections are dead anyway, we should not pass them to prepareRequestFunction()
and drop them right away.
For details why this happens, see nodejs/node#23858
Attempting to fix this in 3106aee, after the first check we cannot reliably detect socket close since the address is cached and socket.readyState
is open
.
Thanks!