Ask coding questions

← Back to all posts
How do I make my python server actually be accessed remotely?
ibbysaleemi (0)

I have a python server that gets string data from a client. I need an IPv4 address and port for the client to connect to and server to bind to. How do I get this? thx

Comments
hotnewtop
CSharpIsGud (1061)

Use the meta-address 0.0.0.0 to bind to on the server.
For the client, you can use the domain repl provides.
If you really need a ip address on the client you'll just have to resolve it manually with something like dnspython.
But repls proxy will only forward it to your app if its an http request or other http based protocol like websockets. Just plain TCP won't work

ch1ck3n (2076)

replit uses proxy so you cant get IPs

ibbysaleemi (0)

@ch1ck3n ok, but is there an alternative?

ch1ck3n (2076)

@ibbysaleemi idk, the only one i can think of it ppl's own computers