From 6b80bdd51c5932e4874b3b7eabe710971132c7f0 Mon Sep 17 00:00:00 2001 From: zefie Date: Mon, 16 Jun 2025 18:09:03 -0400 Subject: [PATCH] improve host masking --- zefie_wtvp_minisrv/includes/classes/WTVIRC.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js index 02efc872..5801f333 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js @@ -2544,6 +2544,11 @@ class WTVIRC { // Masked hostname for +x users if (typeof hostname === 'string') { // Mask everything except the first and last octet for IPv4 + // Mask IP-like subdomains (e.g., 1-1-1-1.domain.com) + const ipSubdomainMatch = hostname.match(/^(\d+)-(\d+)-(\d+)-(\d+)\./); + if (ipSubdomainMatch) { + return `${ipSubdomainMatch[1]}-x-x-${ipSubdomainMatch[4]}.${hostname.split('.').slice(1).join('.')}`; + } const ipv4Match = hostname.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/); if (ipv4Match) { return `${ipv4Match[1]}.x.x.${ipv4Match[4]}`;