Sunday, November 8, 2020

Simple http/https proxy using squid

This is a basic proxy setup, whereby you practically does not have to do any settings.

First, install squid in our machine with address 10.0.0.10

# yum install squid -y


Then, start squid service

# systemctl start squid


By default squid runs on port, 3128, so we will allow 3128/tcp on our firewall

# firewall-cmd --add-port 3128/tcp

# firewall-cmd --add-port 3128/tcp --permanent


Now the time to test out our proxy, in a different machine. This test machine does not have any internet connection to the outside world, except network connection to our proxy server.


First we use curl to try to reach ipecho.net/plain without proxy

$ curl ipecho.net/plain

curl: (6) Could not resolve host: ipecho.net


Next we will use curl with our brand new proxy. We can see that our machine is able to reach ipecho.net/plain, with the help of the proxy.

$ curl --proxy http://10.0.0.10:3128 ipecho.net/plain

210.210.210.210


Nice, happy proxying.

No comments:

Post a Comment