I have the same issue that want to use HTTP proxy through SSH. Because many applications only support HTTP proxy, and HTTP proxy is easy to be used in command line environment.
Although searched several pages but I can't find a direct(can be chained with Polipo, Privoxy, or tsocks ) way to do this...
After a days' work, I finished a simple Golang version of HTTP proxy over SSH. Feel free to play with it: mallory.
Currently only support RSA key(located at $HOME/.ssh/id_rsa) and password authorisation.
host
is the SSH server address, port
is 22
if is not changed by your admin.
The server side is just our old friend sshd
with zero configuration.
mallory -engine=ssh -remote=ssh://host:port
or with username user
mallory -engine=ssh -remote=ssh://user@host:port
or with username user
and password 1234
mallory -engine=ssh -remote=ssh://user:1234@host:port
After connected, a HTTP proxy will serve on localhost:1315.
ssh -D user@host:8080
?-D
specifies a port to open the tunnel on, not the port to connect to. (Even the connection port is specified as-p port
, not:port
, for compatibility reasons.)