apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
https://www.npmjs.com/package/proxy-chain
Apache License 2.0
804 stars 138 forks source link

fix: Handle socket timeout to prevent connections from leaking #407

Closed jirimoravcik closed 1 year ago

jirimoravcik commented 1 year ago

https://nodejs.org/api/net.html#event-timeout Emitted if the socket times out from inactivity. This is only to notify that the socket has been idle. The user must manually close the connection.

jirimoravcik commented 1 year ago

Nice! How did you find this?

netstat -pnat | grep 8000 https://serverfault.com/questions/738300/why-are-connections-in-fin-wait2-state-not-closed-by-the-linux-kernel

kami4ka commented 1 year ago

I thought it was my finding https://github.com/apify/proxy-chain/issues/362#issuecomment-1356260697 😂 Nice job, guys! Thanks for sharing this part of the functionality. The library is very cool for the domain and the community.

jirimoravcik commented 1 year ago

I thought it was my finding #362 (comment) 😂 Nice job, guys! Thanks for sharing this part of the functionality. The library is very cool for the domain and the community.

Yeah, thanks for your comment. I started with my own investigations and then later found out you commented the same thing :D