• Advertisement
Sign in to follow this  

Simulating internet connection on localhost

This topic is 2061 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

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
can you simply set a router to do this? [/quote]

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.

Share this post


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

  • Advertisement