fix(portproxy): Adjust safe timeout defaults in PortProxy to prevent overflow issues.

This commit is contained in:
Philipp Kunz 2025-03-06 23:00:24 +00:00
parent f3fd903231
commit cb6c2503e2
3 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,12 @@
# Changelog # Changelog
## 2025-03-06 - 3.28.2 - fix(portproxy)
Adjust safe timeout defaults in PortProxy to prevent overflow issues.
- Adjusted socketTimeout to maximum safe limit (~24.8 days) for PortProxy.
- Adjusted maxConnectionLifetime to maximum safe limit (~24.8 days) for PortProxy.
- Ensured enhanced default timeout settings in PortProxy.
## 2025-03-06 - 3.28.1 - fix(PortProxy) ## 2025-03-06 - 3.28.1 - fix(PortProxy)
Improved code formatting and readability in PortProxy class by adjusting spacing and comments. Improved code formatting and readability in PortProxy class by adjusting spacing and comments.

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartproxy', name: '@push.rocks/smartproxy',
version: '3.28.1', version: '3.28.2',
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, and dynamic routing with authentication options.' description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, and dynamic routing with authentication options.'
} }

View File

@ -325,11 +325,11 @@ export class PortProxy {
...settingsArg, ...settingsArg,
targetIP: settingsArg.targetIP || 'localhost', targetIP: settingsArg.targetIP || 'localhost',
// Timeout settings with our enhanced defaults // Timeout settings with safe limits for Node.js
initialDataTimeout: settingsArg.initialDataTimeout || 60000, // 60 seconds for initial handshake initialDataTimeout: settingsArg.initialDataTimeout || 60000, // 60 seconds for initial handshake
socketTimeout: settingsArg.socketTimeout || 2592000000, // 30 days socket timeout socketTimeout: settingsArg.socketTimeout || 2147483647, // Maximum safe value (~24.8 days)
inactivityCheckInterval: settingsArg.inactivityCheckInterval || 60000, // 60 seconds interval inactivityCheckInterval: settingsArg.inactivityCheckInterval || 60000, // 60 seconds interval
maxConnectionLifetime: settingsArg.maxConnectionLifetime || 2592000000, // 30 days max lifetime maxConnectionLifetime: settingsArg.maxConnectionLifetime || 2147483647, // Maximum safe value (~24.8 days)
inactivityTimeout: settingsArg.inactivityTimeout || 14400000, // 4 hours inactivity timeout inactivityTimeout: settingsArg.inactivityTimeout || 14400000, // 4 hours inactivity timeout
gracefulShutdownTimeout: settingsArg.gracefulShutdownTimeout || 30000, // 30 seconds gracefulShutdownTimeout: settingsArg.gracefulShutdownTimeout || 30000, // 30 seconds