Closed personstays closed 6 years ago
If both machines are behind a NAT, then UDP hole punching won't work and the two machines won't be able to talk to each other. Eventually, we could come up with a way of coordinating mutual hole punching using a coordination node, but that would require a lot of work.
Hello,
Thanks for this good project. I have been trying to use this project to test the peer to peer discovery. I have the following setup. (2 nodes over NAT and one Non-NATed bootstrap node)
from kademlia.network import Server
handler = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) log = logging.getLogger('kademlia') log.addHandler(handler) log.setLevel(logging.DEBUG)
server = Server() server.listen(8468)
loop = asyncio.get_event_loop() loop.set_debug(True) loop.run_until_complete(server.bootstrap([("", 8468)]))
try: loop.run_forever() except KeyboardInterrupt: pass finally: server.stop() loop.close()