Http support by ssh


Please pardon me for silly questions as I am new to GO. :slight_smile:

Using GO’s ssh package, I am trying to implement SSH tunneling using port forwarding.

I have implemented a ssh client and sshd server. The ssh handshake is successful using Private/Public keys for authentication.
On the remote machine where sshd is running, I need to forward the request to a Port which is exposed locally and is behind Apache Server.
As far as I know, Apache accepts only http/https requests. On the other hand the request tunneled via ssh client - sshd is of type “tcp”.

It would be indeed grateful if anyone will be able to help me out!

Thanks in advance


Why do you want to make a raw TCP to request to a HTTP server? Why not talk HTTP to it?

An http or https connection is a tcp connection. So if you are doing end to end forwarding at layer 3 (ie not interpreting the protocol) then it should work fine. That is how ssh -L forwarding works anyway.

I want to connect UltraVNC viewer to UltraVNC repeater. The connection is unsecured as it does not implement SSL/SSH. To do so I am using SSH Port Forwarding. The UltraVNC repeater is behind Apache as I do not want to expose it to the outside network.