https://github.com/somehowchris/peek-reverse-proxy
Simple reverse proxy to peek into requests
https://github.com/somehowchris/peek-reverse-proxy
api http hyper peek reverse-proxy rust
Last synced: 6 months ago
JSON representation
Simple reverse proxy to peek into requests
- Host: GitHub
- URL: https://github.com/somehowchris/peek-reverse-proxy
- Owner: somehowchris
- Created: 2022-03-16T14:50:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-15T08:08:28.000Z (6 months ago)
- Last Synced: 2025-04-15T09:24:40.914Z (6 months ago)
- Topics: api, http, hyper, peek, reverse-proxy, rust
- Language: Rust
- Homepage:
- Size: 277 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# peek reverse proxy
Sometimes you do not have a network traffic interceptor, proxy such as burp or F12 debug tools to inspect requests. This simple reverse proxy is a simple solution to that.
> DISCLAIMER: do not use this as a production ready thing, was never designed for this## Purpose
Sometimes there are is just that one environment where you can't have a debug mode.
If you've mocked an API just to look at the request sent fear no more. This client lets you host a http listener to peek into request details such as bodies, queries, headers and proxy the request to the destination at the same time.
## Usage
### Install
You can use this crate via several distributions:
- `cargo install` via crates.io
- `cargo install` from source
- `docker`, `podman` or any OCI container runtime
- `cargo binstall`
- binaries from gh releases#### Cargo binstall
To install this crate via `cargo-binstall`:
```sh
cargo binstall peek-reverse-proxy
```#### Cargo
To install this crate via `cargo`:
```sh
cargo install peek-reverse-proxy
```#### From Source
```
git clone https://github.com/somehowchris/peek-reverse-proxy.gitcd peek-reverse-proxy
cargo install --path .
```#### Docker/Containers
```sh
docker pull ghcr.io/somehowchris/peek-reverse-proxy:0.1.12
```### Run it
#### Installed binary
Once installed, you can run it via:
```sh
peek-reverse-proxy
```##### Configuration
Env variables allow you to configure things to your needs:
- `HOST_ADDRESS`: address on which to listen on i.e. `0.0.0.0:8080`
- `DESTINATION_URL`: destination url including host and scheme i.e. `https://www.google.com`
- (optional) `LOG_LEVEL`: level of logs to log __off__, __debug__, __normal__, __critical__, defaults to `normal`
- (optional) `PRINT_STYLE`: print style for logs, either __json__ (outputs everything in json style), __plain__ (outputs everything in standard log formats but has no json field formatting), __pretty__ (just as plain, but formats outputs of json fields with serde_jsons pretty option), defaults to `pretty`For example:
```sh
export HOST_ADDRESS="0.0.0.0:8080"
export DESTINATION_URL="https://www.google.com"
export PRINT_STYLE="json"
export LOG_LEVEL="normal"peek-reverse-proxy
```#### Docker
```sh
docker run -e HOST_ADDRESS="0.0.0.0:8080" -e DESTINATION_URL="https://www.google.com" -p 8080:8080 ghcr.io/somehowchris/peek-reverse-proxy:0.1.12
```