GithubHelp home page GithubHelp logo

chrahunt / reverse-forward-proxy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 14 KB

Reverse proxy in front of a forward proxy

License: MIT License

Python 93.74% Dockerfile 2.05% Makefile 1.88% Shell 2.33%

reverse-forward-proxy's Introduction

reverse-forward-proxy

Reverse proxy to resources behind a forward proxy. The purpose of this is to simplify configuration of clients or allow scaling behind load balancers that do not support forward proxying on the back-end (e.g. HAProxy, Squid, Apache).

Usage

# Required.
HTTP_PROXY=http://192.168.1.2:8080
# Optional. Defaults to $HTTP_PROXY
HTTPS_PROXY=http://192.168.1.2:8080
# Optional.
SSL_CERT_FILE=
# Optional. Enabled when set to '1'
REVERSE_FORWARD_PROXY_VERBOSE=
# Optional. Default is "localhost"
REVERSE_FORWARD_PROXY_HOST=
# Optional. Default is "8080"
REVERSE_FORWARD_PROXY_PORT=
# Optional. Default is "X-Reverse-Forward-Proxy-Target"
REVERSE_FORWARD_PROXY_TARGET_HEADER=
reverse-forward-proxy

Now the server will be up and listening on http://localhost:8080 for requests.

Requests must have header X-Reverse-Forward-Proxy-Target set to the remote host to connect to via the proxy.

The server will make the request via $HTTP_PROXY and return the response.

Testing

pytest
make docker-test
docker run --rm --net=host svagi/h2load --h1 -n 100 -c5 -H "X-Reverse-Forward-Proxy-Target: http://files/" http://localhost:$(make get-port)/file.100m

reverse-forward-proxy's People

Contributors

chrahunt avatar

Watchers

James Cloos avatar

Forkers

khurtado

reverse-forward-proxy's Issues

Did you ever find a way to do this with e.g. nginx, haproxy etc.

Somehow this repo and the corresponding stack overflow question are the only places on the internet that I can find where someone wants to put a reverse proxy in front of a forward proxy. I am also in this predicament and can't see any documentation on how it should be configured in any common proxy software. Did you ever find out why nobody does this or if it's possible with off-the-shelf software?

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.