I'd like a way to be able to grab the IP addresses of clients as they connect or when they send a command, and so far I haven't found a way online; is there a way?
You can do this in the usual Flask way, using the request object. The request.remote_addr attribute contains the IP address of the client. But if you are using a reverse proxy, then remote_addr is always going to be the address of your proxy. In this case, the ProxyFix middleware may be of help.
Ahh I see. The proxy issue must by why it didn't work when I tried..
Cheers.
Most helpful comment
You can do this in the usual Flask way, using the
requestobject. Therequest.remote_addrattribute contains the IP address of the client. But if you are using a reverse proxy, thenremote_addris always going to be the address of your proxy. In this case, the ProxyFix middleware may be of help.