I know how to use http_proxy to redirect http request, but how to redirect the data with a socket5 proxy such as a SSH tunnel?

  • What do you mean? Do you want to redirect the output of a command through the network? Or to redirect an HTTP request through an SSH tunnel? Or something else? Please clarify. Apr 2, 2012 at 22:45

3 Answers 3


For bash network request to redirect through socket5 proxy, you have to export http_proxy variable:

$ export http_proxy=socks5://username:passwd@socks5_proxy_ip:port

  • 1
    This is unrelated to bash, it is up the the started application if to use or not the value of that variable.
    – enzotib
    Apr 2, 2012 at 6:57
  • 3
    I encourted the Unsupported scheme socks5'` error.
    – steveyang
    Apr 3, 2012 at 5:57

Look at the tsocks application, it is able to transparently redirect every network request of a controlled application through a given socks proxy.


The only way I could make it work reliably (on MacOS, but I expect bash behaves the same in unix/linux) was using proxychains.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .