项目作者: yegor256

项目描述 :
Docker image for a Squid forward proxy with authorization (fully anonymous)
高级语言: Dockerfile
项目地址: git://github.com/yegor256/squid-proxy.git
创建时间: 2019-08-02T14:23:02Z
项目社区:https://github.com/yegor256/squid-proxy

开源协议:MIT License

下载


Docker Image of an Anonymous HTTP Proxy

docker
Docker Cloud Automated build
License

This
Docker
image helps you start your own Squid
proxy server, with HTTP Basic authorization.
You may need this if you want your crawling/scaping software
to look like constantly going to the Network from the same IP address. You
rent a VPS, start a Squid server there and configure your software to
go everywhere through an explicit HTTP(S) proxy.

When Docker is installed, run this:

  1. $ docker run --name proxy --detach --restart=always --publish 8081:3128 \
  2. --env USERNAME=jeffrey --env PASSWORD=swordfish \
  3. yegor256/squid-proxy

Now you can connect to localhost:8081 with jeffrey:swordfish
credentials. For example:

  1. curl -vvv --proxy http://jeffrey:swordfish@0.0.0.0:8081 https://google.com/

Or, with httpie:

  1. http --proxy=http:http://jeffrey:swordfish@0.0.0.0:8081 https://google.com/

BTW, the proxy is anonymous.
Once it’s up and running, you can check whether it’s visible,
here. It also doesn’t store any logs and doesn’t
cache any content.

You can also use Docker compose:

  1. version: '3'
  2. services:
  3. proxy:
  4. image: yegor256/squid-proxy
  5. restart: always
  6. ports:
  7. - "8081:3128"
  8. environment:
  9. - USERNAME=jeffrey
  10. - PASSWORD=swordfish

Developing

Build it locally:

  1. docker build . -t squid-proxy:latest

Want to push to a local machine?

  1. docker save squid-proxy | ssh -C your@machine docker load