https://github.com/dagit/proctor
A simple proof of concept HTTP proxy
https://github.com/dagit/proctor
Last synced: 4 months ago
JSON representation
A simple proof of concept HTTP proxy
- Host: GitHub
- URL: https://github.com/dagit/proctor
- Owner: dagit
- License: bsd-3-clause
- Created: 2021-06-25T17:16:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-25T20:32:26.000Z (almost 5 years ago)
- Last Synced: 2024-12-31T04:41:59.576Z (over 1 year ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
`proctor` will proxy your HTTP traffic for you. All it needs is a list
of allowed remote servers and a port to listen on.
This is really just a simple and quick proof of concept I made to
learn how HTTP proxies work. It's not heavily tested, featureful, or
otherwise ready for serious use. I did all the HTTP parsing and other
bits myself to see how they work. I would recommend using the
appropriate libraries instead.
# Usage
```
proctor
USAGE:
proctor.exe [FLAGS] --port [HOSTNAME]...
ARGS:
... Remote servers that can be connected to on port 443
FLAGS:
-d, --debug Debug mode
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-p, --port Port to listen on
```
You must specify at least one `HOSTNAME`.
To see it work, you might run a test like this:
```sh
cargo run -- -p 8080 api.giphy.com
```
The above command tells your `proctor` to listen on localhost:8080 and
only allow proxy connections to `api.giphy.com`. Any other proxy
request would be denied.
Then in a different shell:
```sh
curl -x https:://localhost:8080 'http://api.giphy.com/v1/gifs/search?q=I&api_key=dc6zaTOxFJmzC' --ssl-reqd
```
However, this example will just result in an error unless you setup
cURL to work with giphy's api. For instance, you would need an API key
and other things.