Sign in to follow this  

Connecting to Remote Host from Home Machine

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


Disclaimer: About 80% of what I know about networking comes from reverse engineering.

I am trying to write a basic client-server-model networking library in Python.  It is available FOSS here. I have tested this library with a client and server on my local machine, but now I want to try it in the Real World.

For testing, I have SSH access to two exterior hostings--one on webfactional and one at a university, both running Linux.  I can run a server from either place through a remote shell, but I cannot connect to it.

In my test (using values from the webfactional hosting):
-I open an SSH shell.  I find the host's name through "hostname" (it is ""), and then find an ip address through "host <name>" (it is "").
-I start the server via an SSH shell.  The server's socket binds on a given port and the ip address found above ("", 6317).
-I start the client on my local machine.  The client's socket attempts to connect to the ip address above and the same port (so again: "", 6317).
-The connection never takes; the client times out, and the server appears completely oblivious--as if no incoming connection was attempted.

I don't know if my approach for this test makes any sense, but it's my best guess.

If it's not something silly like that, I suspect the problem has to do with the NAT, since very similar code worked at my previous residence under a different network setup (though I don't know how it was tested).  However, I don't know what could actually be causing such a tie-up, unless it is a NAT on the server's end.

I'm really confused on the whole thing.  I'm not looking to set up a peer-to-peer connection per-se, although I would like to allow those behind a NAT to host a server.  Can someone clarify and explain this mess?

Edited by Geometrian

Share this post

Link to post
Share on other sites
Your problem is most likely NAT, and/or firewalls that work much like NAT (with connection tracking,) on both the university side and the cheap webhost side.
You solve this by getting a real host that does not NAT/firewall your programs -- typically, a VPS or similar. That server can either be the game server, or it can be a NAT introducer for the actual server.
More information about NAT punch-through is found in the FAQ.

Share this post

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