Skip to content
← Back to Community
Get flask by ip
Profile icon
h
has Hacker Plan
shirser121

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
Profile icon
shirser121
Comments
hotnewtop
Profile icon
Coder100

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

Profile icon
shirser121

@Coder100
so it's impossible?

Profile icon
Coder100

yeah basically

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

Profile icon
shirser121

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

Profile icon
Coder100

well that doesn't mean the ip works lol

make sure it is run on IP 0.0.0.0
@shirser121

Profile icon
shirser121

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

Profile icon
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.

Profile icon
shirser121

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

Profile icon
ch1ck3n

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

Profile icon
Bhone-MM

@shirser121 I see what you are talking about. Open cmd on windows and use the ping command. How to do it

Profile icon
InvisibleOne
import socket print(socket.gethostname())
Profile icon
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

Profile icon
InvisibleOne

try typing curl ifconfig in the shell tab @shirser121

Profile icon
shirser121

@InvisibleOne
not working