Crates.io | cli-proxy |
lib.rs | cli-proxy |
version | 0.3.5 |
source | src |
created_at | 2017-10-14 02:53:41.643327 |
updated_at | 2018-02-05 05:49:31.406799 |
description | cli proxy server |
homepage | |
repository | https://github.com/jaemk/proxy |
max_upload_size | |
id | 35567 |
size | 29,468 |
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
See releases
,
cargo install cli-proxy
,
Or build from source:
cargo build --release
Updates:
github
releases) is available behind --features update
releases
are compiled with the update
featureproxy self update
Development proxy
# - 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
# - generate crate documentation
cargo doc
# - serve / request with target/doc/<crate>/index.html
# - serve static files starting with "/" from target/doc
# - serve static files starting with "/" from target/doc/<crate>
proxy serve . \
--file /,target/doc/<crate>/index.html,text/html \
--static /,target/doc \
--static /,target/doc/<crate>
Static file server
# - serve static files from the current directory
proxy fs .