Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
b3ba0c21e8 | |||
ef707a5870 |
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-02-27 - 3.16.5 - fix(PortProxy)
|
||||
Improved connection cleanup process with added asynchronous delays
|
||||
|
||||
- Connection cleanup now includes asynchronous delays for reliable order of operations.
|
||||
|
||||
## 2025-02-27 - 3.16.4 - fix(PortProxy)
|
||||
Fix and enhance port proxy handling
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@push.rocks/smartproxy",
|
||||
"version": "3.16.4",
|
||||
"version": "3.16.5",
|
||||
"private": false,
|
||||
"description": "A robust and versatile proxy package designed to handle high workloads, offering features like SSL redirection, port proxying, WebSocket support, and customizable routing and authentication.",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartproxy',
|
||||
version: '3.16.4',
|
||||
version: '3.16.5',
|
||||
description: 'A robust and versatile proxy package designed to handle high workloads, offering features like SSL redirection, port proxying, WebSocket support, and customizable routing and authentication.'
|
||||
}
|
||||
|
@ -140,14 +140,18 @@ export class PortProxy {
|
||||
let outgoingTerminationReason: string | null = null;
|
||||
|
||||
// Ensure cleanup happens only once for the entire connection record.
|
||||
const cleanupOnce = () => {
|
||||
const cleanupOnce = async () => {
|
||||
if (!connectionRecord.connectionClosed) {
|
||||
connectionRecord.connectionClosed = true;
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
if (connectionRecord.cleanupTimer) {
|
||||
clearTimeout(connectionRecord.cleanupTimer);
|
||||
}
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
if (!socket.destroyed) socket.destroy();
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
if (connectionRecord.outgoing && !connectionRecord.outgoing.destroyed) connectionRecord.outgoing.destroy();
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
this.connectionRecords.delete(connectionRecord);
|
||||
console.log(`Connection from ${remoteIP} terminated. Active connections: ${this.connectionRecords.size}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user