I'm thinking of developing a proxy-like program to forward ports on a remote PC to a local PC (for example SSH). Assume that both local and remote PCs are running behind typical firewalls (i.e. consumer broadband router firewall, Windows firewall or corporate firewalls).
The program will be a Java program which the user will run on both the remote and local PC. The remote client will periodically poll a central server to determine whether there are pending client connections. A session could be initiated as follows:
- The local client contacts the central server and request the current connection details for a specific remote client.
- The central server responds with the remote server's last received IP address and port.
- The next time the remote server polls the central server, the client's IP address and port are returned. The remote server initiates a connection to the local client using the IP address and port returned by the central server and listens for a response on a random port. The remote server will pass the value of the port it's listening on to central server.
- Goto 1, if client fails to connect to server.
All coomunication with the central server will be via HTTP/HTTPS on ports 80 & 443.
Would this work or will a typical firewall block the interactions.