Im working on an online game, but I'm having an annoying issue with me and my friend testing. The thing is, I set the client to connect to my WAN IP so he can connect, but then I cannot connect as it only work with localhost or 127.0.0.1. If I set it to localhost, obviously he cannot connect.

I also tried using a DNS server, which used to work but recently I set it up again and it's not working.

Any ideas on how I can get a single domain or IP that works for a local connection and a WAN connection?

link|improve this question
feedback

migrated from stackoverflow.com Jun 18 '11 at 9:36

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 2 down vote accepted

Add an entry to your hosts file.

In your hosts you can write: 127.0.0.1 thegame

and your friend can write: [your wan ip] thegame

Then you can both connect to thegame.

link|improve this answer
Wow thanks, I'm pretty sure this is what I did last time when it was working and forgot to add it after I formatted my PC. Thanks again – Brad Jun 18 '11 at 7:20
feedback

Your Answer

 
or
required, but never shown