Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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

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

add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.