Skip to content

davydany/squid-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Squid Forward Proxy

The goal of this project is to quickly test out instances where you need a forward proxy, with custom SSL Certificates.

Prerequisites

  • Docker
  • Docker Compose
  • ~500MB of free disk space for caching
  • Open ports 3128 and 4128 (if running locally)

How to Run Proxy Server

  • Clone this repository in your working directory.
git clone git@github.com:davydany/squid-proxy.git $PROJECT_HOME/squid-proxy
  • Change directory to $PROJECT_HOME/squid-proxy:
$PROJECT_HOME/squid-proxy
  • Run the Project
docker compose up 

How to Use Proxy Server

This is how you'd normally do curl:

curl https://ip.oxylabs.io/location

Here is how you'd do it by using this proxy server:

curl https://ip.oxylabs.io/location -x http://localhost:4128/ --cacert ./cert/CA.pem

Configure All Outbound Traffic to use Proxy Server

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

RESET: If you need to reset the commands above, do this:

iptables -t nat -D OUTPUT -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:4128
iptables -t nat -D OUTPUT -p tcp --dport 443 -j DNAT --to-destination 127.0.0.1:4128

Now, reset iptables:

iptables -t nat -F

# really reset things (if the above commands don't work)
iptables -F
iptables -t nat -F
iptables -X

# verify
iptables -t nat -L --line-numbers -v

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages