Open andersnas opened 23 hours ago
A thought, as the nodecat code is likely running behind a proxy it may be worth adding the real connecting IP in a X-Forwarded-For header and the ASN (ALPN) in a X-Forwarded-For-ALPN header instead of using the built in req.socket.remoteAddress?
That sounds like a good idea. I know most of the time that might be the case.
In cat.js we need to obtain the IP and ASN (ALPN) from local objects instead of Akamai variables:
validateCatnip const clientIp = request.getVariable("PMUSER_CLIENT_IP");
validateCatalpn const alpn = request.getVariable("PMUSER_ALPN"), alpnHex = base16.encode((new TextEncoder).encode(alpn));