clientAddress
clientAddress(
req,trustProxy?):string
The client’s address for the per-address limits. Behind a proxy (Caddy, nginx) every socket comes from the proxy, so all players would
share one address and the limits (20 sockets, 30 joins a minute) would cap the whole server: with trustProxy, a request from a private
or loopback peer is taken at the last X-Forwarded-For entry (the address the proxy saw). From any other peer the header is ignored, so a
player cannot pick their own address.
Parameters
Section titled “Parameters”headers
Section titled “headers”Record<string, string | string[] | undefined>
socket
Section titled “socket”{ remoteAddress?: string; }
socket.remoteAddress?
Section titled “socket.remoteAddress?”string
trustProxy?
Section titled “trustProxy?”boolean = false
Returns
Section titled “Returns”string