pub struct ReverseServerConfig {
pub control_bind: SocketAddr,
pub external_bind: Option<SocketAddr>,
pub auth_username: Option<String>,
pub auth_password: Option<String>,
pub max_control_connections: u32,
pub read_timeout_ms: u64,
pub allow_bind: Option<Vec<SocketAddr>>,
pub max_listeners_per_client: u32,
pub max_streams_per_listener: u32,
pub max_pending_external: u32,
pub tls: Option<ReverseServerTlsConfig>,
}Expand description
Configuration for a reverse proxy server (acceptor side).
The server accepts control connections from remote clients and dispatches externally-accepted connections back through the control channel.
Fields§
§control_bind: SocketAddrAddress to bind the control listener on.
external_bind: Option<SocketAddr>Address to bind the external listener on (for clients to connect to).
auth_username: Option<String>Optional username for authentication.
auth_password: Option<String>Optional password for authentication.
max_control_connections: u32Maximum concurrent control connections.
read_timeout_ms: u64Read timeout in milliseconds (for idle control connections).
allow_bind: Option<Vec<SocketAddr>>Optional list of allowed external bind addresses. When Some and
non-empty, the server rejects bind addresses not in the list.
When None or empty, no allowlist enforcement is applied.
max_listeners_per_client: u32Maximum number of external listeners per control client. Currently pproxy supports one external listener per control connection, so defaults to 1.
max_streams_per_listener: u32Maximum concurrent streams per external listener.
max_pending_external: u32Maximum number of concurrent external clients queued while waiting for a control connection. Excess clients are dropped.
tls: Option<ReverseServerTlsConfig>Optional TLS for the control channel. When present, the TCP control stream is wrapped with Rustls before reverse framing/authentication. External listener traffic remains plaintext TCP.
Implementations§
Source§impl ReverseServerConfig
impl ReverseServerConfig
Sourcepub fn is_bind_allowed(&self, addr: SocketAddr) -> bool
pub fn is_bind_allowed(&self, addr: SocketAddr) -> bool
Returns true if the supplied external bind address is allowed by the
configured allow_bind policy. When allow_bind is None or empty,
all addresses are allowed.
Sourcepub fn is_loopback(addr: SocketAddr) -> bool
pub fn is_loopback(addr: SocketAddr) -> bool
Returns true if the address is loopback (127.0.0.0/8 or ::1).
Sourcepub fn validate(&self) -> Result<(), ProtocolError>
pub fn validate(&self) -> Result<(), ProtocolError>
Validate this configuration. Returns an error if the configuration is
unsafe (e.g. external bind on a non-loopback address without
authentication and without an explicit allow_bind allowlist).
This is a defense-in-depth check: it catches misconfigurations that would otherwise expose the reverse proxy to unauthenticated network clients. TLS material is validated here as well so impossible combinations fail before any socket is bound.
Trait Implementations§
Source§impl Clone for ReverseServerConfig
impl Clone for ReverseServerConfig
Source§fn clone(&self) -> ReverseServerConfig
fn clone(&self) -> ReverseServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more