-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
As topic.
If you use this server as a web proxy, because websites nowadays make a lot of requests, it also creates a lot of sockets on socksv5 server. As all successful sockets are not closed, it will eats up all system resources and emits EMFILE error shortly. As a result, the server is no longer working anymore.
After some investigations, in server.js, I found out that after the dstSock (the socket between proxy server and destination server) is closed, it do not close the client socket together.
To fix this, just need to add close event and destroy the client socket.
server.js
function proxySocket(socket, req) {
....
dstSock
.on('error', onError)
//////////// Missing Part ///////////
.on('close', () => {
socket.end()
socket.destroy()
})
//////////// Missing Part End ////////////////////
.on('connect', function() {
connected = true;
if (socket.writable) {
....However, it seems that this project is abandoned. My recommendation is you should not use this library.
Metadata
Metadata
Assignees
Labels
No labels