Giter VIP home page Giter VIP logo

docker-proxy's Introduction

docker-proxy

Introduction

Getting started

Installation

docker pull jolestar/proxy-server
docker pull jolestar/proxy-client

or check out the code. Then build with:

cd server && make
cd client && make

Quickstart

Start server using:

docker run --name proxy-server -d --restart=always -p 5000:5000 \
 -v /srv/docker/docker-proxy/cache:/var/spool/squid \
 -v /srv/docker/docker-proxy/cert:/etc/docker-proxy/cert/ \
jolestar/proxy-server

Get auto generated proxy password using:

docker logs proxy-server 2>&1 |grep docker-proxy

Adding password for user docker-proxy
username: docker-proxy password: <password>

The password only generated for proxy-server first start, you can rm /srv/docker/docker-proxy/cert/passwd and restart proxy-server for regenerate. You also can change password or add more user by:

htpasswd /srv/docker/docker-proxy/cert/passwd docker-proxy

Then copy /srv/docker/docker-proxy/cert/stunnel.pem to your client /srv/docker/docker-proxy/cert/ .

Start client using:

export PROXY_SERVER=<Your Server IP>
docker run --name proxy-client --add-host server:$PROXY_SERVER -d --restart=always -p 5001:5001 \
 -v /srv/docker/docker-proxy/cert:/etc/docker-proxy/cert/ \
jolestar/proxy-client

Usage

Export env for global using:

export ftp_proxy=https://docker-proxy:<password>@localhost:5001
export http_proxy=https://docker-proxy:<password>@localhost:5001
export https_proxy=https://docker-proxy:<password>@localhost:5001

Command line var for one-time using:

https_proxy=https://docker-proxy:<password>@localhost:5001 curl https://google.com

Logs

To access the Squid logs, located at /var/log/squid/, you can use docker exec. For example, if you want to tail the access logs:

docker exec -it proxy-server tail -f /var/log/squid/access.log

You can also mount a volume at /var/log/squid/ so that the logs are directly accessible on the host.

docker-proxy's People

Contributors

jolestar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.