An open API service indexing awesome lists of open source software.

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

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.