how to make an online p2p multiplayer game

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

So basically im trying to make an onlione multiplayer game.

I already know how to do it locally, but i dont know how to do it online.

In my current understanding of networking, you connect to a client using tcp with an i.p. and port, and I think it only works when you are connected to LAN (i dont think that if i send my ip to my friend in a different network, i will be able to connect to him). I am confused to how to connect to someone through the internet and would love if someone explained to me how to do just that.

:bust_in_silhouette: Reply From: Vincent Grossmayer

Im also not fully sure, but by sharing your global ip address (not the local one) your should be able to connect already.

is there a way to get the global ip inside of godot? ill try this with my friend and we’ll se if that’ll work. thanks!

dustin | 2020-07-24 14:31

ok, so i tried doing that, and when i get my phone and my computer public ip, both of them are the same. how do i connect to one of them only?

dustin | 2020-07-25 06:12