diff --git a/changelog.md b/changelog.md index e3a619e..beec6c4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2025-03-01 - 3.20.1 - fix(PortProxy) +Improve IP allowance check for forced domains + +- Enhanced IP allowance check logic by incorporating blocked IPs and default allowed IPs for forced domains within port proxy configurations. + ## 2025-03-01 - 3.20.0 - feat(PortProxy) Enhance PortProxy with advanced connection cleanup and logging diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 431ee16..7387680 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartproxy', - version: '3.20.0', + version: '3.20.1', 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.' } diff --git a/ts/classes.portproxy.ts b/ts/classes.portproxy.ts index 7782050..a25714b 100644 --- a/ts/classes.portproxy.ts +++ b/ts/classes.portproxy.ts @@ -413,7 +413,15 @@ export class PortProxy { domain => domain.portRanges && domain.portRanges.length > 0 && isPortInRanges(localPort, domain.portRanges) ); if (forcedDomain) { - if (!isAllowed(remoteIP, forcedDomain.allowedIPs)) { + const effectiveAllowedIPs: string[] = [ + ...forcedDomain.allowedIPs, + ...(this.settings.defaultAllowedIPs || []) + ]; + const effectiveBlockedIPs: string[] = [ + ...(forcedDomain.blockedIPs || []), + ...(this.settings.defaultBlockedIPs || []) + ]; + if (!isGlobIPAllowed(remoteIP, effectiveAllowedIPs, effectiveBlockedIPs)) { console.log(`Connection from ${remoteIP} rejected: IP not allowed for domain ${forcedDomain.domains.join(', ')} on port ${localPort}.`); socket.end(); return;