You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proxy works for few days and then suddenly cpu spikes to 100% and doesn't come down i have to restart the machine to make it work again. I am attaching code and cpu snapshot. On this server nothing other than this code is running. I have same code running on 5 machines and all having same issue.
importsocks5from'simple-socks';letstats={};//not big object since I only proxy traffic to 5 domainsletAUTH={user: 'test',pass: 'test'};constoptions={authenticate : function(username,password,socket,callback){if(username===AUTH.user&&password===AUTH.pass){returnsetImmediate(callback);}returnsetImmediate(callback,newError('incorrect username and password'));}};functionupdateStats(info){constip=info.address;stats[ip]=stats[ip] ? stats[ip]+1: 1;console.log('Proxy Stats:',stats);}constserver=socks5.createServer(options);// Better Logging and error handlingserver.on('proxyConnect',(info,destination)=>{updateStats(info);console.log(`[ProxyConnect] Connected to remote server at ${info.address}:${info.port}`);destination.on('data',(data)=>{console.log(`[ProxyConnect] Data received from ${info.address}:${info.port}. Length: ${data.length} bytes`);});});server.on('proxyData',(data)=>{console.log(`[ProxyData] Data received. Length: ${data.length} bytes`);});server.on('proxyError',(err)=>{console.error('[ProxyError] Unable to connect to remote server.');console.error('Error:',err.message);});server.on('proxyDisconnect',(originInfo,destinationInfo,hadError)=>{consterrorStatus=hadError ? 'with error' : 'without error';console.log(`[ProxyDisconnect] Client ${originInfo.address}:${originInfo.port} request disconnected from remote server at ${destinationInfo.address}:${destinationInfo.port}${errorStatus}`);});server.on('proxyEnd',(response,args)=>{console.log(`[ProxyEnd] Socket closed with code ${response}. Args:`,args);});server.listen(8080,()=>{console.log(`Server started at ${newDate().toISOString()}`);});
The text was updated successfully, but these errors were encountered:
Proxy works for few days and then suddenly cpu spikes to 100% and doesn't come down i have to restart the machine to make it work again. I am attaching code and cpu snapshot. On this server nothing other than this code is running. I have same code running on 5 machines and all having same issue.
The text was updated successfully, but these errors were encountered: