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
- Host: GitHub
- URL: https://github.com/soylent/eventmachine-proxy
- Owner: soylent
- Created: 2020-05-15T01:02:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-18T03:07:12.000Z (6 months ago)
- Last Synced: 2025-06-25T05:30:34.966Z (6 months ago)
- Topics: eventmachine, https-proxy, proxy
- Language: Ruby
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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