Question : C# - Disguising TCP as HTTP to bypass firewall restrictions like TeamViewer?

TeamViewer is a famous remote desktop control software that uses TCP in combination with a private mirror driver to retrieve the remote screen with great performance. TeamViewer advertises its ability to connect to any PC regardless of firewall restrictions and router restrictions. I discovered how by looking at earlier versions of TeamViewer. In the early releases of TeamViewer, it used DynGate, a commercial (and now non-existant) software that disguses TCP connections as HTTP connections over port 80.

I am unsure if this means:
a) the TCP protocol is tunneled (hope that's the right term) as HTTP
(tcp)

b) or if there is an intermediate proxy server which forwards data from the client to server and vice versa.
 <--->  Intermediary Server <--->

I have searched the internet for articles on how to implement this general concept in C#. I found a poorly documented article here: http://www.codeproject.com/KB/cs/Httptunnel.aspx.

I'm not even sure what the tech term is for what I'm trying to achieve. I need my application to be able to send data to another computer as HTTP data because HTTP data on port 80 is automatically accepted? Please correct me. I understand you can't open a TCP connection to any remote computer and expect it to connect because firewall and NAT restrictions will block it. I just don't know how to describe/achieve the opposite.

Does anybody also know any articles that can give me a good direction on this in C#?

Answer : C# - Disguising TCP as HTTP to bypass firewall restrictions like TeamViewer?

Hi again,

"Must there be an intermediary server between both computers to relay data? Isn't there a simpler solution?"
- Between 2 computers with REAL ip addresses, no there is no need.
- Between 2 computers when one has a real IP address, and he is the one listening, no - there is no need.
- Between 2 computers when both are behind NATs unless you have port-forwarding, then yes, you must use a 3rd computer, which by the way, must not be behind a NAT, or has to be accessible with port-forwarding.

I have added a picture i drew in mspaint, it will make it easier to understand - Just a few terms now.
1. NAT - Invented to save money. Uses 1 real ip address, to hide multiple private ip addresses.
    The nat is the main problem of creating a peer to peer connection between 2 computer behind NATs.
    As far as computer A knows, the ip address of computer B is the ip address of the NAT.
2. When an incoming TCP connection arrives to the NAT (from computer A) it has a destination ip address of the NAT, what is the NAT supposed to do now? to which computer shell the NAT send that packet?
It doesn't know! it can't know, UNLESS you configure port-forwarding, OR computer B is the one that starts the connection.
3. NAT prevents inbound connections, unless port forwarding is configured.

When you use teamViewer, both users install a Client on their PCs, they both actively have to start the program, and the program fires up a connection to the teamViewer servers. The 3rd computer which relays the data between the computers.

In the Link you pasted, you can see the schematics, they describe a setup where both IOLAN servers have REAL ip addresses, so they are not facing the NAT problem, the http tunneling is not the solution for NAT problems, it's a solution for strict firewall problems.
Random Solutions  
 
programming4us programming4us