Jump to content

  • Log In with Google      Sign In   
  • Create Account


Simulating internet connection on localhost


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Rasterman   Members   -  Reputation: 206

Like
0Likes
Like

Posted 30 May 2012 - 01:11 PM

I am testing my networked game, I have tested it on the same machine, on the same machine with simulated lag (random 500ms delay between sending receiving network messages on both client and server), and between 2 separate machines on my LAN. For the next step I would like to test over a real internet connection, is there a way to pipe my clients connection to the internet somewhere then back to my server even though both compters are on the same LAN?

Sponsor:

#2 hplus0603   Moderators   -  Reputation: 5155

Like
1Likes
Like

Posted 30 May 2012 - 06:48 PM

Yes. Look at port forwarding. For TCP, many SSH clients (like Putty, on Windows) has that capability, as does several load balancing proxies, such as HAProxy. You can also do the same kind of tunnel both for TCP and UDP with "netcat."

Easiest setup:

1) Make sure there's an open port on your firewall that goes to client B.
2) Open up netcat on a remote machine, set it up in listen mode, and forward to the open port on your firewall.
3) Open up client A, and point it at the port that netcat is listening on on the remote machine.

Edited by hplus0603, 30 May 2012 - 06:48 PM.

enum Bool { True, False, FileNotFound };

#3 Rasterman   Members   -  Reputation: 206

Like
0Likes
Like

Posted 31 May 2012 - 09:18 AM

Thanks for the info, I looked at netcat but have found little docs on it, and several people saying it doesn't work for this purpose for windows. I found a port forwarder called http://sourceforge.n...s/pjs-passport/ that might work. I was wondering though can you simply set a router to do this? Have a remote router forward the port back to me? Or does this only forward the negotation of the connection, and then when the connection is created nothing is forwarded since both machines are local to me? Since I'm using UDP which is connectionless though wouldn't every packet need to be forwarded and it would work? But I guess it would only be one way correct, when the server sends back to the forwarded client that wouldnt work would it?

Edited by Rasterman, 31 May 2012 - 09:49 AM.


#4 hplus0603   Moderators   -  Reputation: 5155

Like
0Likes
Like

Posted 31 May 2012 - 05:35 PM

can you simply set a router to do this?


Typically, no. A router will only port forward to an address that's on the inside.

Windows is not a great host for network experimentation, as the ecosystem is not as systems focused as on UNIX derivatives. I would recommend spinning up a command-line Linux instance in a virtual machine (VirtualPC, VMWare, whatever) as the remote server, if your only option for the remote server is Windows.

enum Bool { True, False, FileNotFound };

#5 Rasterman   Members   -  Reputation: 206

Like
0Likes
Like

Posted 01 June 2012 - 06:11 AM

I got it working with Simple UDP Proxy/Pipe 0.4.1, getting a 150ms ping with some packet loss, testing is good so far. Thanks for your direction :)

Edited by Rasterman, 01 June 2012 - 06:21 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS