openvibers/openvibe.chat Commits

Chat: the IP-resolution diagnostic only with CHAT_LOG_IP_RESOLUTION=1 (it logged every connection's addresses: its 'first few' test never stopped) (#115)

OP OpenVibers committed 28 days ago · 81fdcf4521 · 1 file, +4 −2

Changes

ddiff --git a/server/chat/chat-server.js b/server/chat/chat-server.js
iindex 0a854ac..6dc5fcb 100644
---- a/server/chat/chat-server.js
++++ b/server/chat/chat-server.js
@@@ -260,8 +260,10 @@ class ChatServer {
handleConnection(ws, req) {
const ip = this.getClientIp(req);
-- // Diagnostic: log IP resolution chain for first few connections
-- if (this.anonMap.size < 20) {
++ // Diagnostic, on demand only (CHAT_LOG_IP_RESOLUTION=1): the header chain behind the resolved address. It used to
++ // log every connection's addresses (its "first few" test was anonMap.size < 20, which stays small), putting
++ // visitors' IPs in the journal for nothing (2026-10-17).
++ if (process.env.CHAT_LOG_IP_RESOLUTION === '1') {
console.log('[Chat] IP resolution — cf-connecting-ip:', req.headers?.['cf-connecting-ip'] || '(none)',
'| x-forwarded-for:', req.headers?.['x-forwarded-for'] || '(none)',
'| x-real-ip:', req.headers?.['x-real-ip'] || '(none)',