TcpGateway - A listen-listen TCP gateway in C#

TcpGateway is a listen-listen TCP gateway (Gender Changer, TCP relay) for Windows. It may be used to bypass NAT routers, e.g. for VNC, or for testing purposes.

Download and Sources

Gateway classes source:  TcpGateway.cs
Windows Service source: TcpGatewayService.cs
Test programs: TestTcpGateway.cs, TcpStressTest.cs
Download full package:  TcpGateway.zip

How to use the Tcp Gateway with the Java VNC Viewer Applet

TcpGateway may be used with the VNC viewer applet. I recommend to use the RealVNC freeware version of vncviewer.jar. (The current UltraVNC version of the applet does not work with TcpGateway, because it opens two TCP connections, one before the password prompt and one after the password prompt).

The following HTML code may be used to place the applet on a HTML page:

<script src="http://java.com/js/deployJava.js"></script>
<script>
deployJava.runApplet(
{archive:"vncviewer.jar", code:"vncviewer/VNCViewer.class", width:"250", Height:"400"},
{port:"1001"},
"1.4");
</script>

The port number for the applet (1001) has to be one of the ports configured in TcpGatewayService.xml. The VNC server has to do a callback (add new client) to the other port using a host name like www.example.com::1002.



Author: Christian d'Heureuse (www.source-code.biz, www.inventec.ch/chdh)
Index