Expand description
hyperlane-plugin-gateway
High-concurrency reverse proxy and API gateway plugin for Hyperlane providing prefix/host routing, allocation-free load balancing (round-robin, weighted, least-connections, power-of-two-choices), circuit breaking, lock-free GCRA rate limiting, extensible interceptors, RFC 9110 hop-by-hop header stripping, and pooled HTTP/1.1 + HTTP/2 forwarding.
Structs§
- Gateway
Config - Top-level configuration for
GatewayRuntimeandGatewayPlugin. - Gateway
Hook - Opt-in
ServerHookforwarding matched requests throughGatewayPlugin. - Gateway
Plugin - Process-wide
GatewayPluginregistry storingGatewayRuntime. - Gateway
Route - Routing, load-balancing, retry, and rate-limit definition for one gateway prefix.
- Gateway
Runtime - Compiled thread-safe reverse-proxy engine backing
GatewayPluginandGatewayHook. - Rate
Limit Config - Token-bucket rate-limit parameters attached to a
GatewayRoute. - Upstream
Target - One upstream backend endpoint participating in a
GatewayRoute.
Enums§
- Load
Balance Strategy - Upstream selection algorithm used by a
crate::GatewayRoute.
Constants§
- DEFAULT_
CIRCUIT_ FAILURE_ THRESHOLD - Default consecutive upstream failure count before opening the circuit breaker.
- DEFAULT_
CIRCUIT_ RESET_ MS - Default circuit breaker open cooldown window in milliseconds.
- DEFAULT_
GATEWAY_ MAX_ BODY_ SIZE - Default maximum forwarded request body size (10 MiB).
- DEFAULT_
UPSTREAM_ TIMEOUT_ MS - Default upstream request timeout in milliseconds.
- HEADER_
X_ FORWARDED_ FOR - Standard
X-Forwarded-Forheader name. - HEADER_
X_ FORWARDED_ HOST - Standard
X-Forwarded-Hostheader name. - HEADER_
X_ FORWARDED_ PROTO - Standard
X-Forwarded-Protoheader name. - HEADER_
X_ GATEWAY_ UPSTREAM - Standard
X-Gateway-Upstreamdiagnostic header name.
Traits§
- Gateway
Interceptor - Pluggable interceptor invoked around upstream reverse-proxy forwarding.
Functions§
- build_
upstream_ url - Rewrites an incoming path + optional query string onto
base_url. - is_
hop_ by_ hop_ header - Reports whether
nameis an RFC 9110 hop-by-hop header that proxies must not forward. - path_
matches_ prefix - Reports whether
pathmatchesprefixon an exact path-segment boundary.