Your question is a bit unclear. In your title you state that you want to connect two devices with a live server. So you're speaking of three devices or at least programs.
Inside your question you state the the second player IS the server. That would be a kind of peer to peer (P2P) network approach.
First of all. Godot offers some different multiplayer network options. You also can either connect two clients to a server (all running godot) or let one device be the server.
Second: Forget about localhost/127.0.0.1 (not 0). This is a virtual local address and only works when all software runs on a single device.
Third: There are multiple ways to connect two devices via the network of with another server. And there are also potential problems depending on what you want to achieve.
You can have a server software running on a hosted server. This server usually has at least an ip or even a domain/hostname mapped to it. The hosting package has to allow running custom software on it though. It is also possible to run such a server on an own device an configure your router port mapping and dynDNS so that external users can access the port+device from outside.
Some info about godot servers:
You can have both clients running in the same network. If the network allows two clients "speaking" to each other (often not the case in public wifi networks) then you can simply let one client be the server and access it via its local ip + port (such a local IP often begins with 192.168.).
Port mapping or UPnP:
If the router is (manually) configured the forward a port to the specific "server" device IP the client can connect to the dial-in IP of the server (this is the temporary IP that is assigned to the router on dial in) + port. Or the router can be configured via UPnP to do the port mapping (but not all routers allow this for obvious security reasons):
If both clients access the internet via IPv6 then they might both have world wide unique IPv6 addresses to adress each other. (As long as the router/firewall allows it).
NAT punch through:
In IPV4 networks there's a method to circumvent the portmapping/address dilemma which occurs with routers when both clients are in different local networks. You'll still need a hosted server + software to initiate the client<->client communication but the server won't need to route/proxy the traffic.
See this answer: