• Advertisement
Sign in to follow this  

Simple NAT punch?

This topic is 1237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, 
 
I'm creating a very simple turn-based multiplayer game. I'm using winsock and TCP protocol, with a host - client way.
The program is working, but i don't know how to connect 2 pc when both of them are behind a router.
I read about NAT, but we don't have access to our router (for port-forward) and we can use only a few internet port.
 
I also read about the indroducer, but 1)can i find a free introducer in the web?   2) can i choose the port for the communication?
There are some other way that suit my situation?
 
Thanks for reading and sorry for my bad English.

Share this post


Link to post
Share on other sites
Advertisement

Try this link, also found in the Forum FAQ.

 

I don't think there are any sites out there that will act as an public, general purpose introducer for nat traversal. I think that is something you will need to provide specific for your own game server. You will need to write the code within your game for each side to exit their own side of the NAT, then have the introducer server relay the connection information to each other and use it to poke the holes.

 

Many (but not all) consumer devices support UPnP or NAT-PMP. If they are supported you can tell the NAT to expect the message without needing a trusted introducer. It requires several steps, but avoids the difficulty of the always-on publicly accessable server if you don't want to go that route.

Share this post


Link to post
Share on other sites

I'm just in the process of solving the same problem. I'm using RakNet which has recently become open sourced, their website has lots of information about NAT punchthrough, and you can always selectively grab their sourcecode if you don't want to integrate the entire system.

 

Raknet run their own free NAT punchthrough server, however, it's been down for the last couple of days so I've been relying on uPNP instead. The downtime of their server has convinced me that I should host my own server rather than rely on a third party (particularly a third party who I'm not paying and can't reasonably expect any support from).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement