Run the following in your client machine
ssh -R EXPOSED_PORT:localhost:SERVICE_PORT USER@HOST
Where
- EXPOSED_PORT is the port exposed to the internet in the proxy server
- SERVICE_PORT is the port your application is listening in your machine
- USER is the username of the ssh user
- HOST is the proxy server host
EXPOSED_PORT is the same as PORT_TARGET in proxy.js
If proxying does not work, check if you have set the following line in your sshd config of the proxy server
GatewayPorts clientspecified
After you haved logged in to the ssh server, run the proxy
2014-04-04 - TJC: This forked version rewrites the Location header on 3xx responses, changing the origin host to the request's host, so the client uses the appropriate host for follow-up requests.