How cloudflare/pingora works
Pingora is a Rust framework for building programmable network services, especially HTTP proxies. The principal workflow is a client request accepted by a server, decoded as HTTP, handled by proxy logic, routed to an upstream, and returned to the client. The workspace also provides load balancing, caching, TLS options, and observability integrations. The graph preserves major documented capabilities; several links use README-level evidence because the corresponding runtime wiring was not sampled.
Main entry points: lib.rs Proxy framework · server Server and listeners · storage.rs Cache storage · server.rs HTTP/1 handling
Components 20
Server and protocols
- Server and listeners
pingora-core/src/server - HTTP/1 handling
pingora-core/src/protocols/http/v1/server.rs - HTTP/2 handling
pingora-core/src/protocols/http/v2/server.rs - HTTP primitives
pingora-core/src/protocols/http/authority.rs - Custom HTTP
pingora-core/src/protocols/http/custom/server.rs - HTTP subrequests
pingora-core/src/protocols/http/subrequest/server.rs - Raw connections
pingora-core/src/protocols/raw_connect.rs
Proxy workflow
- Proxy framework
pingora-proxy/src/lib.rs - HTTP/1 proxying
pingora-proxy/src/proxy_h1.rs - Custom proxying
pingora-proxy/src/proxy_custom.rs
Upstream routing
- Load balancing
pingora-load-balancing/src/lib.rs - Upstream service
Caching
- Proxy cache integration
pingora-proxy/src/proxy_cache.rs - Cache storage
pingora-cache/src/storage.rs - Cache keys
pingora-cache/src/key.rs - Memory cache
pingora-memory-cache/src/lib.rs
Workspace services
- TLS implementations
pingora-core/src/protocols/tls - Telemetry integrations
pingora-foundations/src/lib.rs - Public API crate
pingora/src/lib.rs
Other components
- HTTP client
Connections 19
- HTTP client → Server and listeners: sends requests
- Server and listeners → HTTP/1 handling: accepts HTTP/1
- Server and listeners → HTTP/2 handling: accepts HTTP/2
pingora-core/src/protocols/http/v2/server.rs - HTTP/1 handling → Proxy framework: serves proxy requests
- HTTP/2 handling → Proxy framework: serves proxy requests
- Proxy framework → Load balancing: selects upstream
- Load balancing → Upstream service: selects backend
- Proxy framework → Upstream service: proxies requests
- Upstream service → Proxy framework: returns responses
- Proxy framework → HTTP client: returns responses
- Proxy framework → HTTP/1 proxying: dispatches HTTP/1
pingora-proxy/src/lib.rs - Proxy framework → Custom proxying: supports custom logic
pingora-proxy/src/lib.rs - Proxy framework → Proxy cache integration: integrates caching
pingora-proxy/src/lib.rs - Proxy cache integration → Cache storage: reads and writes
- Cache storage → Cache keys: keys entries
pingora-cache/src/storage.rs - Memory cache → Cache storage: provides async caching
- Server and listeners → TLS implementations: supports TLS
- Server and listeners → Telemetry integrations: integrates telemetry
- Public API crate → Server and listeners: exposes framework APIs