Skip to main content

Crate hyperlane_plugin_gateway

Crate hyperlane_plugin_gateway 

Source
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§

GatewayConfig
Top-level configuration for GatewayRuntime and GatewayPlugin.
GatewayHook
Opt-in ServerHook forwarding matched requests through GatewayPlugin.
GatewayPlugin
Process-wide GatewayPlugin registry storing GatewayRuntime.
GatewayRoute
Routing, load-balancing, retry, and rate-limit definition for one gateway prefix.
GatewayRuntime
Compiled thread-safe reverse-proxy engine backing GatewayPlugin and GatewayHook.
RateLimitConfig
Token-bucket rate-limit parameters attached to a GatewayRoute.
UpstreamTarget
One upstream backend endpoint participating in a GatewayRoute.

Enums§

LoadBalanceStrategy
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-For header name.
HEADER_X_FORWARDED_HOST
Standard X-Forwarded-Host header name.
HEADER_X_FORWARDED_PROTO
Standard X-Forwarded-Proto header name.
HEADER_X_GATEWAY_UPSTREAM
Standard X-Gateway-Upstream diagnostic header name.

Traits§

GatewayInterceptor
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 name is an RFC 9110 hop-by-hop header that proxies must not forward.
path_matches_prefix
Reports whether path matches prefix on an exact path-segment boundary.