Skip to content

dotcommoners/revenprox

Repository files navigation

RevenProx

License: MIT Zig Build Status Docker

A high-performance, horizontally scalable Server-Sent Events proxy built in Zig for real-time event streaming at scale.

RevenProx delivers SSE connections to millions of concurrent clients with JWT authentication, distributed state synchronization via NNG mesh topology, and topic-based message routing.

Features

  • Massive Scale - Designed for 10M+ concurrent connections across 100+ proxy instances
  • Brokerless Architecture - No central message broker; fully distributed using NNG mesh
  • Topic-Based Routing - UUID-based topics for efficient, targeted event delivery
  • JWT Authentication - Secure webhook-based token verification with caching and circuit breaker
  • Built in Zig - Maximum performance with minimal memory footprint
  • Production Ready - Rate limiting, connection pooling, graceful shutdown, observability

Quick Start

Prerequisites

  • Linux (kernel 4.x+)
  • Zig 0.15.1+
  • NNG library (libnng-dev)

Installation

# Clone the repository
git clone https://github.com/dotcommoners/revenprox.git
cd revenprox

# Install dependencies and build
./install.sh

# Or build manually
zig build -Doptimize=ReleaseSafe

Run the Proxy

# Start with default configuration
./zig-out/bin/sse-proxy --config config/proxy.toml

Connect a Client

# Subscribe to events on a topic
curl -N "http://localhost:8080/events/my-topic" \
  -H "Authorization: Bearer <jwt-token>"

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   HTTP Server   │    │ Connection Pool │    │  JWT Verifier   │
│   (SSE Endpoint)│    │   Management    │    │   (Webhook)     │
└─────────┬───────┘    └─────────┬───────┘    └─────────┬───────┘
          │                      │                      │
          └──────────────────────┼──────────────────────┘
                                 │
                    ┌────────────┴────────────┐
                    │   Distributed State     │
                    │ (Bloom + Merkle + Vector)│
                    └────────────┬────────────┘
                                 │
                    ┌────────────┴────────────┐
                    │    NNG Topic Router     │
                    │   (PUB/SUB with topics) │
                    └─────────────────────────┘

Documentation

RevenProx has two documentation sets for different audiences:

Documentation Location Audience Description
User Guide documentation/ Operators & Developers Installation, configuration, API reference, deployment guides
Technical Specs docs/ Contributors Internal architecture, protocols, component specifications

User Guide

The user-facing documentation covers everything needed to deploy and operate RevenProx:

To serve the documentation locally:

cd documentation && mkdocs serve

Technical Specifications

The internal documentation provides deep technical details for contributors:

Configuration

RevenProx uses TOML configuration:

proxy_id = "proxy-1"
log_level = "info"

[http]
bind_address = "0.0.0.0:8080"
max_connections = 10000

[jwt_verifier]
webhook_url = "http://auth-server/verify"
require_authentication = true

[limits]
max_memory_mb = 1024

See Configuration Overview for all options.

Docker

# Build the image
docker build -t revenprox:latest .

# Run with Docker Compose
docker-compose up

Development Status

RevenProx is under active development. Core infrastructure is implemented and functional. See the documentation for current capabilities and roadmap.

Contributing

Contributions are welcome. Please review the technical specifications before submitting changes.

License

MIT License - see LICENSE for details.

About

A high-performance, horizontally scalable Server-Sent Events proxy built in Zig for real-time event streaming at scale.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors