fix(PortProxy): Fixed indentation issue and ensured proper cleanup of sockets in PortProxy
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartproxy',
|
||||
version: '3.4.2',
|
||||
version: '3.4.3',
|
||||
description: 'a proxy for handling high workloads of proxying'
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ export class PortProxy {
|
||||
}
|
||||
}
|
||||
} else if (!this.settings.defaultAllowedIPs || !isAllowed(remoteIP, this.settings.defaultAllowedIPs)) {
|
||||
console.log(`Connection rejected: IP ${remoteIP} not allowed for non-SNI connection`);
|
||||
from.end();
|
||||
return;
|
||||
}
|
||||
console.log(`Connection rejected: IP ${remoteIP} not allowed for non-SNI connection`);
|
||||
from.end();
|
||||
return;
|
||||
}
|
||||
|
||||
const to = plugins.net.createConnection({
|
||||
host: this.settings.toHost!,
|
||||
@ -150,6 +150,8 @@ export class PortProxy {
|
||||
to.on('end', () => {
|
||||
cleanUpSockets(from, to);
|
||||
});
|
||||
};
|
||||
|
||||
this.netServer = server
|
||||
.on('connection', handleConnection)
|
||||
.on('secureConnection', handleConnection)
|
||||
|
Reference in New Issue
Block a user