Skip to content

Squid Explicit Forward Proxy if there are IP restrictions on target servers and resources; and your code is running in cloud or dont have static IP for some other reason.

License

Notifications You must be signed in to change notification settings

polarbit/squid-forward-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

squid-forward-proxy

Some key features:

  • Only allowes access to domains specifies in the squid.whitelist file.
  • Basic http authentication is builtin. And users can be added later. (Container restart is required.)
  • You can change squid.conf file for your custome settings. (Container restart is required.)

See Resources:

Create Users

sudo apt install apache2-utils

# 1st user
sudo htpasswd -cb squid.passwords ${SQUIDUSERNAME} ${SQUIDPASSWORD}

# Other users
sudo htpasswd -b squid.passwords ${SQUIDUSERNAME2} ${SQUIDPASSWORD2}  

If htpasswd is not installed yet, install it first.

sudo apt install apache2-utils

Build and Run Docker Container

# Build container image
docker build -t safakulusoy/squid-forward-proxy .

# Run container
docker run -it --name squid -d --restart=always --publish 3128:3128 \
--volume ${PWD}/squid.conf:/etc/squid/squid.conf \
--volume ${PWD}/squid.whitelist:/etc/squid/squid.whitelist \
--volume ${PWD}/squid.passwords:/etc/squid/squid.passwords \
safakulusoy/squid-forward-proxy:latest

# See Squid logs
docker exec -it squid tail -f /var/log/squid/access.log

# Squid bash
docker exec -it squid bash

Test

wget http://postman-echo.com/get?name=houston \
-e use_proxy=yes \
-e http_proxy=http://${SQUIDUSERNAME}:${SQUIDPASSWORD}@localhost:3128

About

Squid Explicit Forward Proxy if there are IP restrictions on target servers and resources; and your code is running in cloud or dont have static IP for some other reason.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published