this is a lightweight http server that redirects requests to another http server.
- install nim using dom96/choosenim
- clone the repo
- run
nimble install argparse
- run
nim -d:ssl c src/main.nim
Usage:
[options]
Options:
-h, --help
-p, --port=PORT The port to listen on. (default: 0)
-u, --url=URL The base URL to which to forward requests.
-H, --hostheader=HOSTHEADER
The value for the host header. (default: )
-P, --printheaders Print request & response headers.
-b, --printbody Print request & response body.
-t, --transparent Be transparent about client's original IP address (X-Forwarded-For).
--port 8080 --url http://localhost:8000
: listen for htp requests on port 8080 and forward every request to localhost:8000.
--port 8080 --url http://localhost:8000 -t
: same as above example but now the original client IP address is sent via the headers (X-Forwarded-For
)