Ask coding questions

← Back to all posts
What IP address does this return?
RhinoRunner (833)

I found a bit of code that gives you your public IP address, and for some reason when I run it on replit.com, it gives me an IP that is not mine (172.18.0.4).
Why it no work?

NOTE: if I edit the post, the last section of the IP changes.

Comments
hotnewtop
[deleted]

Loook at this : https://replit.com/@IL2PG/Get-IP-Address#main.py Or here is a pic

19ecal (230)

That's presumably the IP of the particular replit server that the repl is running on. If you run that on your local machine it should (?) give you your IP address (?).

I don't really know that was a bit of a guess tbh
RhinoRunner (833)

@19ecal I know, if I run it with my PC's terminal it will give me mine.

IntellectualGuy (709)

I don't think you're allowed to do that anyways, you can get banned because of it

[deleted]

Not sure it’s a private network so maybe repl.it has made it so that you can not steal there ip