mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
feat: add wildcard "*" to allow all hosts to connect via websocket
This commit is contained in:
parent
df20c5fc93
commit
abd0351f8f
@ -33,7 +33,8 @@ export class WebsocketController extends EventController implements EventControl
|
||||
const { remoteAddress } = req.socket;
|
||||
const websocketConfig = configService.get<Websocket>('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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user