How do I obtain the IP address of a user in Flask?
I currently use
request.remote_addr
to get an IP Address but I keep getting 172.18.0.1
Is replit blocking this?
Voters
28klotlucas2
You can use some javascript code to get the it, but getting the ip of a user with javascript is easily spoofable against tos!
Coder100
psst you can fix it by making a custom domain so it isn't restricted by replit
but this is against tos, so don't ever publicly release ips.
[deleted]
I mean like if you mess by creating the repl enviorment inside of a repl you could get it working without the proxy interfearing
ANDREWVOSS
@novaflippers The proxy is likely running outside the VM, in which case that wouldn't work.
ANDREWVOSS
As far as I know, you can't collect IP's in replit. It's against the TOS anyway, so if you figure out how to do it you might get your repl removed.
Replit uses a proxy that messes with the request's IP address, so that's not possible
maybe you could implement an api key system?
psst none of this stuff is allowed by tos
@notGilbert