0

I wanted to write a program with could send and receive data over a NAT router without having to set up port forwarding first. Do i need to use the bittorrent protocol or is there something better?

Ali
  • 4,311
  • 11
  • 44
  • 49
  • 1
    You can use plain TCP if only one side is behind NAT, this side has to start the connection. If both sides are behind NAT you will need a relay that isn't. – Paulo Scardine Oct 23 '10 at 03:20

1 Answers1

2

BitTorrent is not a NAT traversal technology but a P2P file sharing protocol. Unless you want to transfer files BitTorrent probably won't help much.

Some routers will let you setup a port mapping using UPnP. (see this other question to find a Python UPnP client library)

An alternative would be to setup Teredo tunneling on your machine. That will hopefully take care of NAT traversal and give you a real unfirewalled IPv6 address behind your IPv4 NAT router.

Community
  • 1
  • 1
Alex Jasmin
  • 39,094
  • 7
  • 77
  • 67