3

I've read this question and want to do something slightly different:

How to use OpenVPN behind a HTTP and HTTPS proxy?

I have a few local services that I want to connect to the internet through OpenVPN. I don't want to send my entire stack through there so the obvious way seems to be to run an OpenVPN server that can be connected to as though it's a HTTP proxy as such:

Service (machine 1) => HTTP proxy (machine 2) => OpenVPN Client (machine 2) => ProntonVPN => Internet

How would I go about doing this? Every guide I've found has had the OpenVPN and HTTP proxy switched.

If it's of any relevance, every machine concerned is running Arch.

1
  • 1
    If the HTTP proxy server is running on machine 2 and machine 2 is connected to the VPN, then that's it, the proxy will fetch the requests from the internet and that will go through the VPN
    – golimar
    Mar 3, 2020 at 11:08

2 Answers 2

2

For installing OpenVPN, use this: https://github.com/Nyr/openvpn-install

Then you need to install Squid for HTTP Proxy


On Debian 9/10:

Upgrade and update before install

apt-get upgrade
apt-get update

Install OpenVPN https://github.com/Nyr/openvpn-install

wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

Upgrade and update before install

apt-get upgrade
apt-get update

Install Squid

apt-get -y install squid

Edit squid config file by vim, winscp or webmin

vim /etc/squid/squid.conf

Add these lines to the config file.

http_access allow all
http_port 80

Restart Squid Service

service squid restart

Then you should add this line to your Openvpn client config file

http-proxy [Server's IP Address] 80

I hope this will help you.

0
1
+100

You cannot connect a proxy client to a VPN port as they are different technologies.

You will have to run a proxy server on (machine 2) then you can connect to (machine 2) using http proxy. If (machine 2) is getting it's internet from the VPN then naturally that is what it will serve across the proxy.

The reason that you've seen people asking to do this the other way around is that a VPN is secure and an http proxy is not. If you set it up this way you will be exposing a proxy service to the public that uses your VPN. This is likely against the terms of your VPN service because you will be sharing your VPN connection with the planet. Once the scanners catch wind of this there could be a very high volume of traffic suddenly going through your computer and its VPN.

If you want to do this you could use something like mitmproxy, which is an open source solution that runs on Arch. You have been warned not to do this.

https://mitmproxy.org/

2
  • To be clear, the proxy service will not be publicly accessible, it will simply be on my on own secure network. It's mainly just so I can selectively forward certain programs on other machines in my network through the VPN. I'll give mitm a look though, thanks Mar 3, 2020 at 21:26
  • Again, it is not possible to run OpenVPN behind a reverse proxy. However, you might try sshd, or similar builtin OpenVPN protocol switching capability port-share. Feb 6, 2021 at 16:08

You must log in to answer this question.

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