Ask coding questions

← Back to all posts
Get flask by ip
h
shirser121 (2)

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

Comments
hotnewtop
Coder100 (18089)

your server is proxied by replit to the public repl.co domain. If you want to use your own IP, then host locally.

Coder100 (18089)

yeah basically

and plus, why do you need the IP anyways? @shirser121

shirser121 (2)

@Coder100
The repl restarting itself and not always open the url of the flask

Coder100 (18089)

well that doesn't mean the ip works lol

make sure it is run on IP 0.0.0.0
@shirser121

shirser121 (2)

@Coder100
Its work, but sometimes it not...

ch1ck3n (2039)

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 (2)

@ch1ck3n
instead of using "https://myreplname.shirser121.repl.co I want to use IP like X.X.X.X:23423

ch1ck3n (2039)

@shirser121 idk what you're talking about but I don't think its possible

InvisibleOne (2934)
import socket
print(socket.gethostname())
shirser121 (2)

@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 (2934)

try typing curl ifconfig in the shell tab @shirser121