mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 23:51:55 +00:00
log ip address for debugging (TODO remove logging before next release)
This commit is contained in:
@@ -166,11 +166,15 @@ function anonymizeIPv6(ipv6: string): string | null {
|
||||
}
|
||||
|
||||
function anonymizeIP(ip: string): string | null {
|
||||
console.log(`anonymize got ip: ${ip}`)
|
||||
const ipv4Result = anonymizeIPv4(ip);
|
||||
if (ipv4Result) {
|
||||
console.log(`got ipv4 result: ${ipv4Result}`)
|
||||
return ipv4Result;
|
||||
}
|
||||
|
||||
return anonymizeIPv6(ip);
|
||||
const ipv6 = anonymizeIPv6(ip);
|
||||
console.log(`got ipv6: ${ipv6}`)
|
||||
return ipv6
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ wss.on('connection', (ws, req) => {
|
||||
const ip = Array.isArray(forwarded)
|
||||
? forwarded[0] // Get the first IP if it's an array
|
||||
: forwarded || req.socket.remoteAddress;
|
||||
|
||||
console.log(`dev: ip address: ${ip}`)
|
||||
gm.addClient(
|
||||
new Client(
|
||||
clientMsg.clientID,
|
||||
|
||||
Reference in New Issue
Block a user