title: How do I make a TCP server work behind a router (NAT) without any redirection configuration needed
body: <p>The scenario is the following. I have two machines A and B:
  A: Client (behind NAT)
  B: Server (behind NAT)</p>
  
  <p>I want B to be able to listen on any given port, so that A can send packets to B through that specific TCP port and receive any response. If both machines are not behind a NAT it is pretty straight foward process. However how do I make it work so that it works even when B is behind a router, without him having to go change the router configuration enable some port forwarding etc...</p>
  
  <p>For example, how do peer-to-peer programs like torrent clients work without the user having anything to configure?</p>