0

I'm able to proxy requests via SSH SOCKS, when doing:

ssh -fqN -D 127.0.0.1:8080 [email protected]

curl --proxy socks5h://127.0.0.1:8080 -d '{my: parameter}' -H "Content-Type: application/json" http://10.0.30.10

I would like to be able to just type:

curl -d '{my: parameter}' -H "Content-Type: application/json" http://10.0.30.10

As I also need to use the proxy in other applications where I cannot add --proxy socks5h://127.0.0.1:8080 (such as jQuery JavaScript http requests etc.).

Is it possible to add the proxy as a route or in iptables so I can use the proxy in other applications?

1 Answer 1

1

The SOCKS protocol does not transport IP packets, only data streams, so a SOCKS proxy cannot be used as an IP router directly.

You would need additional software like tunsocks or socks-tun which does the necessary translation between SOCKS and TCP/IP.

2
  • I see, make sense. In the documentation it seems tunsocks uses openconnect?, can you give an example on how to use tunsocks in my case? Jan 6, 2017 at 10:43
  • Ah, it looks like tunsocks is in fact the opposite tool. Disregard that. Jan 6, 2017 at 11:09

You must log in to answer this question.

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