Get IP from HTTP headers

This commit is contained in:
Markus Scully 2023-06-05 14:58:42 +02:00
parent 8f2c968403
commit 35ff89faa2

View file

@ -9,7 +9,7 @@ class Connection {
this.connections = net.connections;
this.io = net.io;
this.socket = socket;
this.ip = socket.request.connection.remoteAddress;
this.ip = socket.request.headers['x-real-ip'] ?? socket.request.connection.remoteAddress;
this.player = new Player(this);
this._room = false;