I'm trying to develop a small multiplayer game and I've been reading a lot about how NAT makes P2P impossible. On the other hand I've read a lot of server code which looks something like:
https://docs.python.org/3/library/asyncio-protocol.html#udp-echo-server
def datagram_received(self, data, addr):
message = data.decode()
print('Received %r from %s' % (message, addr))
print('Send %r to %s' % (message, addr))
self.transport.sendto(data, addr)
In the above code the server talks to the client using only plain IP address. Similarly this stackoverflow question
So what am I missing here - is there another way to write UDP send calls or does having them sit on a server auto-magically solves NAT?