How do I get IP Addresses on EVERY platform?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mr. Gamezz

I am attempting to make a game that takes your IP address and simplifies it so that you can use it as a party code. I am also attempting to make this game cross-platform so that it can be run from iOS, Mac, Windows, Android, Linux and on Itch. How would I get the IPv4 address without having to exactly find the IPv4 on every device. I also can’t just go and do every device because I don’t have most of the devices I listed above. Is there just a code that grabs JUST your IP address. (also I have tried IP.get_local_addresses() but it is different on every platform.) For example this is the kind of code I want:

print(get_local_IPv4())

What is was hoping that line of code would do is return “192.168.1.2” (Example IP) or whatever my IP was.

:bust_in_silhouette: Reply From: Gamemap

Maybeone of these answers help you. I think there isn’t a way to get the address for all devices with one code. (Please tell me if I’m wrong.)