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

https://github.com/soylent/eventmachine-proxy

minimal HTTPS (CONNECT) proxy server
https://github.com/soylent/eventmachine-proxy

eventmachine https-proxy proxy

Last synced: 6 months ago
JSON representation

minimal HTTPS (CONNECT) proxy server

Awesome Lists containing this project

README

          

# eventmachine-proxy

Minimal CONNECT proxy server.

## Features

- Tiny.
- Efficient. It uses EM-native proxying methods.
- Backpressure handling. To keep memory usage low and bounded, connections are
paused if the receiver is slower than the sender.
- Secure. Only global unicast addresses are allowed by default.

## Installation

$ gem install eventmachine-proxy

## Usage

```ruby
require "eventmachine-proxy"

EventMachine.run do
EventMachine.start_server("127.0.0.1", 3128, EventMachine::Protocols::CONNECT)
end
```

The code above starts an HTTPS proxy server on port 3128. To test it:

$ curl -px 127.0.0.1:3128 https://example.org

### Options

The following options can be passed as the last argument.

| Option | Description | Default |
|---|---|---|
| `connect_timeout` | Timeout to establish proxy connection | 20.0 s |
| `connection_inactivity_timeout` | Auto-close connection after this inactivity timeout | 0 |
| `connection_buffer_size` | Proxy buffer size, one way | 8 MiB |
| `request_buffer_size` | CONNECT request buffer size | 1 KiB |
| `allow_all` | Allow addresses other than global unicast | false |

## Development

Pull requests are welcome.

To run tests:

$ ruby -Ilib test/test_*

To run the benchmark:

$ ruby -Ilib benchmark.rb