Added NAT code from jackpal/Taipei-Torrent