1
On a normal connection, it is necessary that whoever will receive the connection is with an open port on the router (transmitting to a computer from the internal network). But in a P2P connection this does not happen.
How do P2P programs work independently of this open door? For example, programs like torrent or Gnutella make various connections with network nodes, in the case of torrent has the tracker that can somehow work as a mediator and create a connection between the machines, but in the case of Gnutella there is nothing centralizing, there is only a list of nodes to connect.
How can I implement this initial connection? Assuming that it is not a local connection and that there is no open port on the router (as usually occurs) (It does not necessarily need the code, only the concept is sufficient)
Take a look at this project https://pypi.org/project/pyp2p/
– Augusto Vasques