Installation

yum install -y squid
cs


Configuration

Here is the example of squid configuration (/etc/squid/squid.conf) in order to allow all requests.
visible_hostname localhost
acl all src 0.0.0.0/0.0.0.0
http_access allow all
http_port 3128
cs


You need to restart the squid service after changing the configuration.

systemctl restart squid.service
cs


Configuration on Client

The following env variables should be set.
Note that the assumption is you already have HTTP_PROXY_HOSTNAME.
export http_proxy=http://$HTTP_PROXY_HOSTNAME:3128
export https_proxy=http://$HTTP_PROXY_HOSTNAME:3128
cs


Test

If your host cannot access to public network (e.g. google.com) without proxy, the result of curl must be as following.
# curl -v http://www.google.com
* About to connect() to www.google.com port 80 (#0)
*   Trying 172.217.3.228...
cs


After the proxy configuration, the result should be as following.

# curl -v http://www.google.com
* About to connect() to proxy ebdp-po-dkr10d.sys.comcast.net port 3128 (#0)
*   Trying 147.191.72.175...
* Connected to ebdp-po-dkr10d.sys.comcast.net (147.191.72.175) port 3128 (#0)
> GET http://www.google.com/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.google.com
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
....
cs


+ Recent posts