Get flask by ip
I want to get the IP address my flask app use.
How can I find my flask replit IP for browsing?
I don't want to use the HTTPS address
Voters
ch1ck3n
do you want the client ip
if so you cant
replit uses a proxy so it will always be one IP. you gotta host on it your own.
shirser121
@ch1ck3n
instead of using "https://myreplname.shirser121.repl.co I want to use IP like X.X.X.X:23423
ch1ck3n
@shirser121 idk what you're talking about but I don't think its possible
Bhone-MM
@shirser121 I see what you are talking about. Open cmd on windows and use the ping command. How to do it
InvisibleOne
import socket print(socket.gethostname())
shirser121
@InvisibleOne
this does not work.
and I already try a lot of ways to get the IP, but this is never work
I get the IP, but the server not respond
InvisibleOne
try typing curl ifconfig
in the shell tab @shirser121
shirser121
@InvisibleOne
not working
your server is proxied by replit to the public repl.co domain. If you want to use your own IP, then host locally.
@Coder100
so it's impossible?
yeah basically
and plus, why do you need the IP anyways? @shirser121
@Coder100
The repl restarting itself and not always open the url of the flask
well that doesn't mean the ip works lol
make sure it is run on IP
0.0.0.0
@shirser121
@Coder100
Its work, but sometimes it not...