From abd0351f8f8fac23275837bc9d4827bef8d7eed9 Mon Sep 17 00:00:00 2001 From: micaelmz Date: Tue, 2 Dec 2025 18:01:19 -0300 Subject: [PATCH] feat: add wildcard "*" to allow all hosts to connect via websocket --- src/api/integrations/event/websocket/websocket.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index 72435234..859f67e7 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -33,7 +33,8 @@ export class WebsocketController extends EventController implements EventControl const { remoteAddress } = req.socket; const websocketConfig = configService.get('WEBSOCKET'); const allowedHosts = websocketConfig.ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1'; - const isAllowedHost = allowedHosts + const allowAllHosts = allowedHosts.trim() === '*'; + const isAllowedHost = allowAllHosts || allowedHosts .split(',') .map((h) => h.trim()) .includes(remoteAddress);