Skip to content

Repository files navigation

Roxy

An extensible and modular RPC request router and proxy service built in Rust.

CICrates.ioLicense: MIT

Demo

demo.mov

Overview

Roxy is a JSON-RPC proxy that sits between clients and upstream RPC backends. It distributes requests across multiple backends using exponential moving average (EMA) based health tracking to route traffic toward healthier endpoints. Responses can be cached in a tiered system with an in-memory LRU cache and optional Redis backing. Rate limiting uses a sliding window algorithm to control request throughput. The server accepts both HTTP and WebSocket connections and exposes Prometheus metrics for observability.

Installation

cargo install roxy-proxy

Usage

Run the proxy with a configuration file:

roxy-proxy --config roxy.toml

Validate configuration without starting the server:

roxy-proxy --config roxy.toml --check

Configuration

Create a TOML configuration file:

[[backends]]
name = "primary"url = "https://eth-mainnet.example.com"
[[backends]]
name = "fallback"url = "https://eth-mainnet-fallback.example.com"
[[groups]]
name = "main"backends = ["primary", "fallback"]
load_balancer = "ema"
[routing]
default_group = "main"
[cache]
enabled = truememory_size = 10000
[server]
host = "0.0.0.0"port = 8545
SectionDescription
serverBind address, port, connection limits
backendsUpstream RPC endpoints with timeout and retry
groupsBackend groups with load balancing strategy
cacheMemory size and TTL settings
rate_limitRequests per second and burst limits
routingMethod routing rules and blocked methods
metricsPrometheus metrics endpoint

Acknowledgments

Roxy's design draws inspiration from the commonwarexyz/monorepo.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An Extensible and Modular RPC Request Router and Proxy Service. Built in Rust.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages