0

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. – Gilles 'SO- stop being evil' Apr 2 '12 at 22:45
1

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

| improve this answer | |
  • 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 '12 at 6:57
  • 3
    I encourted the Unsupported scheme socks5'` error. – steveyang Apr 3 '12 at 5:57
1

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

| improve this answer | |
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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