3

I have a socks proxy server set up using Shadowsocks and I have the client on my laptop.

The problem is that I have to configure every single program (using HTTP_PROXY env or manually) to proxy through my socks server.

I wanted to create a VPN Connection in which I config my socks credentials so that when this VPN is connected ALL my network is going through the proxy and when I don't need it I just disconnect the VPN.

Are there any tools to define a new protocol or something in VPN section?

I tried OpenVPN but seems it's not supporting what I want:

My Computer -> VPN -> Socks -> Internet.

2

It's impossible to use Socks as tunneling protocol, so you can't make VPN using Socks. The reason is simple: Socks forwards only TCP (and UDP in Socks5), so other protocol can't pass through Socks.

You can use ProxyChains to pass every connection through your Socks proxy. It does same as Proxifire in MS-Windows.

  • ProxyChains works, but what if I want to create a VPN to my Socks connection so I can Hotspot my VPN connection? (Share a VPN connection). Or is there a way to pass the Socks through Hotspot? – Shayan Mar 8 '18 at 9:41
1

The problem is that I have to configure every single program (using HTTP_PROXY env or manually) to proxy through my socks server.

Forward port 80 to your proxy's port (8080 in here). A command like this would do this temporary (a restart would remove it).

sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:8080

Source: https://unix.stackexchange.com/a/85933/197095

To make this rule permanent, see this question and answer: How can I make a specific set of iptables rules permanent?

0

The VPN solution is too complicated, but it is possible. You have to setup a VPN server and on the VPN server you need to setup a system wide proxy.

The only question is why not to setup the system wide proxy on your client instead of vpn as described here: http://askubuntu/questions/769361/ubuntu-16-04-lts-how-to-force-all-http-https-traffic-to-use-proxy

In firefox there was a toggle proxy extension to swap the connection, nowadays there is a MM3 proxy switch for firefox quantum.

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.