https://github.com/jaemk/proxy
CLI proxy server
https://github.com/jaemk/proxy
cli cli-proxy proxy proxy-server rust
Last synced: 4 months ago
JSON representation
CLI proxy server
- Host: GitHub
- URL: https://github.com/jaemk/proxy
- Owner: jaemk
- License: mit
- Created: 2017-10-14T00:29:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T02:28:43.000Z (about 8 years ago)
- Last Synced: 2025-09-23T19:55:05.136Z (5 months ago)
- Topics: cli, cli-proxy, proxy, proxy-server, rust
- Language: Rust
- Size: 108 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# proxy
[](https://ci.appveyor.com/project/jaemk/proxy/branch/master)
[](https://travis-ci.org/jaemk/proxy)
[](https://crates.io/crates/cli-proxy)
> command-line proxy server
This tool is intended for:
- A quick stand-in for a real proxy server (For development purposes only).
- A **very simple** static site/file server
## Installation
**Pre-compiled executables**
See [`releases`](https://github.com/jaemk/proxy/releases)
**Build from crates.io**
`cargo install cli-proxy`
**Build from source**
- clone this repo
- `cargo build --release`
## Updates
- Self update functionality (from GitHub releases) is available behind `--features update`
- Binary [`releases`](https://github.com/jaemk/proxy/releases) are compiled with the `update` feature
- If you've downloaded a binary release, you can update to latest GitHub release via: `proxy self update`
## Usage
**Development proxy**
```bash
# - listen on `localhost:3000`
# - serve requests starting with `/static/` from the relative path `static/`
# - serve requests starting with `/media/` from the absolute path `/abs/path/to/media
# - serve requests starting with `/assets/` from the relative path `assets`
# - proxy requests starting with `/api/` to `localhost:4001`
# - proxy requests starting with `/status/` to `localhost:4002`
# - proxy remaining requests to `localhost:3002`
proxy serve \
--port 3000 \
--static /static/,static/ \
--static /media/,/abs/path/to/media \
-s /assets/,assets \
--sub-proxy /api/,localhost:4001 \
-P /status/,localhost:4002 \
localhost:3002
```
**Static site server**
```bash
# - generate crate documentation
cargo doc
# - serve / request with target/doc//index.html
# - serve static files starting with "/" from target/doc
# - serve static files starting with "/" from target/doc/
proxy serve . \
--file /,target/doc//index.html,text/html \
--static /,target/doc \
--static /,target/doc/
```
**Static file server**
```bash
# - serve static files from the current directory
proxy fs .
```