$ account cloudflare
Pingora is a production-grade Rust framework for building fast, reliable, and programmable networked systems, developed and battle-tested at Cloudflare (handling 40M+ requests/second). It provides a modular architecture with crates for HTTP/1.1 and HTTP/2 proxying, TLS termination (OpenSSL, BoringSSL, rustls, s2n-tls), load balancing (weighted round-robin, consistent hashing), caching (LRU, TinyUFO), rate limiting, and observability (Prometheus, Sentry). The core abstraction is the `ProxyHttp` trait, which allows users to define request/response filters, upstream selection, error handling, and module integration via lifecycle hooks. The framework also includes a server lifecycle manager with graceful shutdown, daemonization, and file descriptor transfer for zero-downtime upgrades. The architecture is library-oriented: users compose services by implementing traits and configuring YAML-based server settings. Key entry points include `pingora::Server` for process management, `pingora_proxy::http_proxy_service` for creating proxy services, and `pingora_load_balancing::LoadBalancer` for background health checks and discovery. Data flows involve downstream HTTP sessions (H1/H2), upstream connections via pooled connectors, and optional caching layers with eviction policies. External dependencies include tokio, http, h2, lru, ahash, and various TLS libraries. While primarily an application framework, Pingora contains research-grade components like `tinyufo` (a lock-free cache algorithm with TinyLFU admission and S3-FIFO eviction) and `pingora-ketama` (nginx-compatible consistent hashing). These are packaged as reusable crates with extensive benchmarks and memory profiling. The codebase is well-structured with clean trait-based abstractions, but the large workspace (20+ crates) and multiple TLS backends introduce maintenance complexity. Overall, it is a high-quality, actively maintained framework suitable for building custom proxies, load balancers, and edge services.
This repository implements a Cloudflare Worker that runs the OpenClaw personal AI assistant inside a Cloudflare Sandbox container. The worker acts as a reverse proxy, forwarding HTTP and WebSocket traffic to the OpenClaw gateway running on port 18789 inside the container. It provides an admin UI (React SPA) for device pairing management, REST API endpoints for device approval and storage sync, a Chrome DevTools Protocol (CDP) shim for browser automation via Cloudflare Browser Rendering, and debug routes for troubleshooting. The architecture is a single Hono application with middleware for logging, environment validation, and Cloudflare Access authentication. The catch-all route proxies requests to the container, with special handling for WebSocket connections (message interception for error transformation) and crash recovery (automatic gateway restart with R2 backup restore). The codebase is well-structured with TypeScript strict mode, comprehensive unit tests, and a full end-to-end test suite that deploys to real Cloudflare infrastructure. Notable features include a robust process lifecycle manager for the gateway, a cron-based container wake mechanism, and a CDP shim that translates CDP commands to Puppeteer calls.
Cloudflare's CFSSL is a comprehensive PKI/TLS toolkit written in Go, providing both a command-line interface and an HTTP API server for certificate lifecycle management. It handles certificate signing, chain bundling, revocation (CRL/OCSP), TLS scanning, key generation, CSR creation, and CA initialization. The system is modular, with separate packages for CLI commands, API handlers, signers (local/remote), certificate database abstraction (SQLite/MySQL/PostgreSQL), a bundler with chain optimization, an OCSP responder, a TLS scanner, and a transport layer for automated mutual TLS. It uses interface-based design for pluggable backends (signers, database accessors, key providers, trust stores) and includes features like multi-root CA support, pre-issuance linting via zlint, certificate transparency embedding, ubiquity scoring for chain selection, IP whitelisting, HMAC authentication, Prometheus metrics, and post-quantum cryptography (ML-DSA). The codebase also contains custom cryptographic implementations (MD5, SHA-1, SHA-256, SHA-512) with assembly-optimized blocks for performance. While actively maintained with CI/CD and extensive tests, some components show technical drift (pinned Go 1.27, forked TLS library, legacy algorithm support).
Vinext is a Vite plugin that reimplements the Next.js API surface (both App Router and Pages Router) to enable Next.js applications to be built and deployed on Cloudflare Workers and other platforms (Nitro, static export, Node.js). It provides shims for `next/*` modules, implements server-side rendering, caching (ISR, PPR, CDN cache adapters), server actions, middleware, routing, and client-side navigation. The monorepo includes core runtime (`packages/vinext`), Cloudflare-specific adapters (`packages/cloudflare`), a response store service (`packages/workers-response-store`), type shims (`packages/types`), scaffolding CLI (`packages/create-vinext-app`), and a website/benchmarks dashboard (`apps/web`). It has extensive test infrastructure (1700+ Vitest tests, 380 Playwright E2E tests) and a compatibility tracking system. While primarily an application framework, it also contains data/research elements in its benchmarks and compatibility dashboards.
workerd is Cloudflare's JavaScript/Wasm server runtime powering the Cloudflare Workers platform. It implements a nanoservices architecture where all services are deployed to every machine, using a capability-based security model for isolation. The runtime executes serverless Workers in response to HTTP requests, queues, scheduled events, and other triggers, providing APIs for HTTP, storage (KV, Durable Objects, R2), websockets, and more. The core is implemented in Rust and C++ with bindings for JavaScript/TypeScript and Python via Pyodide. Key entry points include the `workerd` CLI binary (built via Bazel) and the Rust `workerd_cli::main()` function. The system processes requests by routing them to Worker isolates, which execute user scripts and can access bindings for subrequests, storage, and other services. It includes extensive compatibility layers for Node.js APIs and Web standards, along with a comprehensive test suite validating spec compliance and implementation correctness.
lua-resty-logger-socket is a Lua library for Nginx (using ngx_lua) that provides nonblocking remote logging. It buffers log messages in memory and sends them to a remote log server (via TCP, UDP, or Unix domain socket) when the buffer reaches a configurable size or when manually flushed. The library implements efficient buffering with two-level buffers to minimize string concatenation, buffer reuse to prevent memory leaks, retry logic for connection and send failures, periodic flushing, and graceful handling of Nginx worker shutdown to flush remaining logs. It supports SSL with SNI and certificate verification.
cloudflare/tls-tris is a Go library that extends the standard library's crypto/tls package with experimental TLS 1.3 support, post-quantum key exchange (SIDH, SIKE, and hybrids), delegated credentials, and 0-RTT. It is not a standalone package; it replaces the Go standard library's crypto/tls via a patched GOROOT. The library implements full client and server TLS 1.3 handshakes, record layer processing, session ticketing, and provides APIs consistent with the standard Go tls package (tls.Config, tls.Conn, tls.Dial). The codebase is derived from Go 1.10-era crypto/tls with extensive modifications. It includes integration with Cloudflare's SIDH library for post-quantum cryptography and supports hybrid key exchange combining X25519 with SIDH or SIKE. The repository contains comprehensive test infrastructure including golden test data files, BoringSSL test suite runner (bogo), Docker-based interop testing against other TLS implementations (NSS, picotls, mint), and Caddy integration examples. However, the TLS 1.3 implementation is based on early IETF drafts (draft-18, -21, -22, -28) and is not compliant with the final RFC 8446. The post-quantum algorithms SIDH and SIKE have been broken by the Castryck-Decru attack; this code is cryptographically obsolete. The library requires a custom Go toolchain (patched from Go 1.10) and cannot be vendored or used as a standard Go module, making it incompatible with modern Go development workflows.
This repository is a React component library for embedding Cloudflare Stream video players. It provides a `<Stream>` component that handles loading the Cloudflare Stream SDK, creates an iframe for the player, and synchronizes React props with the player's imperative API. The architecture centers around custom React hooks for script loading (`useStreamSDK`), property synchronization (`useProperty`), and event management (`useEvent`). The component is designed to be used in React applications, with props controlling video playback, appearance, and event handling. External dependencies include React (peer dependency) and the dynamically loaded Cloudflare Stream SDK.