An implementation of a simple HTTP server acting as a reverse proxy.
- Clone the repo && cd:
git clone https://github.com/kobby-pentangeli/reverse-proxy.git
cd reverse-proxy
- Define and/or edit the
Config.yml
file at the root of the project:
blocked_headers:
- User-Agent
- X-Forwarded-For
blocked_params:
- access_token
- secret_key
masked_params:
- password
- ssn
- credit_card
- Run the server:
cargo run
- In a new terminal, send a request:
curl -i http://127.0.0.1:8100/
A startup needs a reverse proxy to help in data governance. We need to create a simple HTTP server that will act as a reverse proxy. The proxy should be able to handle incoming requests, inspect the request headers, and then forward the requests to the intended destination. In addition, the proxy should be able to log all incoming requests, including the headers and body, and the response headers and body. The proxy should also be able to block certain requests based on a set of predefined rules.
- The reverse proxy should be able to forward any kind of request but inspect only
GET
requests. - The proxy should inspect the response body for any sensitive information and mask it before forwarding the response.
- The proxy should log all incoming requests, including headers and body, and response headers and body.
- The proxy should be able to block requests based on a set of predefined rules. For example, block requests that contain specific headers or parameters.
- Provide a configuration file that allows the startup to define the rules for blocking requests.
- Write unittests to ensure that the proxy is functioning correctly.
- Provide documentation on how to install and run the reverse proxy.
Thank you for considering to contribute to this project!
All contributions large and small are actively accepted.
-
To get started, please read the contribution guidelines.
-
Browse Good First Issues.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this codebase by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.