[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 581
  • Last Modified:

socket connections behind routers


I created a tcp stream client/server winsock program in C++, they work fine if both machine are directly connected to the modem. However I am in a situation where the client, server or both can be behind routers,  and I am unable to establish client-server connections.

I don't want to change the router settings and I don't want  the communication to go through some intermediate server.

Are there any software solutions to establish socket connection directly when either party can be behind a router ?  (some sample source code would be appreciated :) )

1 Solution
Jaime OlivaresCommented:
modern router have firewall features
if you want to communicate trough a specific socket port, you must ensure it is unlocked in router configuration.
Or you can try to use a standard port like 80 or 21 but not so recommendable.
You might want to look into tunneling:

http://www.ssh.com/support/documentation/online/ssh/winhelp/32/Tunneling_Explained.html [" Tunneling Explained"]

This is a very basic problem-- you can't have a server behind a firewall, as most firewalls block incoming connection attempts.   That's the whole point of a firewall.

You have to have some common meeting point that is NOT behind a firewall.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now