Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a http server from a computer that is inside a virtual network to the outside world. I don't have any access to the gateway so cannot configure that. I was thinking that there could be a server outside my network that would work as a proxy for my server. I would make an outbound connection from my computer to this server proxy, and once this connection made every request to the server proxy would be directed to some port in my computer.

Is there something that provides this service? There were several times that I have been in this sit

share|improve this question
you might be able to do this with SSH tunnels – SpacemanSpiff Feb 8 '11 at 20:44

SSH has the ability to do what you want. From inside your "virtual" network, you could create an SSH tunnel to the publically-accessible server with a command line like:

ssh -R ':8080:localhost:80'

For this to work, needs to be running sshd, obviously. Also, the server's sshd_config needs to set GatewayPorts yes, otherwise any tunnel you create will bind only to the server's loopback address, which will be not accessible by remote clients. (The default setting for GatewayPorts is no.)

In the above example, connection attempts to TCP port 8080 on the server will be forwarded to port 80 on localhost.

share|improve this answer
That seem what I am looking for. But do rented web servers generally allow you to edit sshd_config? – Bernardo Kyotoku Feb 8 '11 at 21:54
@Bernardo Kyotoku: Any sane admin of shared hosting would almost certainly not want to enable the GatewayPorts setting. In fact, most of the ones providing ssh access probably disable port forwarding altogether (I would). I am assuming that would be a server that you control. – Steven Monday Feb 9 '11 at 1:39
That what I thought. That is why I specified if there is someone who specifically provides this kind of service. It is not the first time I find myself in this situation. This happens every time I am want to test my webapp in a coffee shop network. – Bernardo Kyotoku Feb 9 '11 at 13:27

You really need to talk to the Network and/or Host Server administrator about this. If for example you're in a corporate environment they might not be too happy with you if you did something like this.

That said, you could probably use an SSH Tunnel, though I don't know how practical that would end up being.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.