'Lightweight remote port forwarding script/tool

I have a Ubuntu computer behind firewall (Comp-In), with all incoming port blocked. I need to run VNC server there. I have another computer running on Windows, that can freely listen to all ports (Comp-Out) from the internet. I want to use Comp-Out to accept VNC client connection request on-behalf of Comp-In. I don't want SSH server running on Comp-Out (I got tons of strange login attempt once I started a SSH server).

So:

  1. Comp-In (port forwarder client) -> Comp-Out (port forwarder server)
  2. Comp-Out (port forwarder server) keeps the Comp-In<->Comp-Out tunnel, and listens to other computers' VNC client requests
  3. Once VNC connection requests happen, the port forwarder server somehow tells forwarder client to launch a connection to localhost VNC server in Comp-Out, then tunnel all data.

Comp-In is in a remote office, with good internet connection and is switched on all the time. The port forwarder needs to be robust to disconnection. Comp-Out is my home computer, is switched on and off daily. I expect Comp-Out only need to liste to two TCP ports, one for tunnel one act as VNC server.

Had checked with this python scripts https://github.com/git-davi/reverse-python-port-forwarder It doesn't really work because it keeps throwing exception whenever VNC client or the tunnel disconnects.

Any suggestion?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source