pub struct ListenerConfig {
pub bind: Option<SocketAddr>,
pub component: String,
pub project: String,
pub site: String,
pub imports: Vec<String>,
pub env: BTreeMap<String, String>,
pub egress_allowlist: Vec<String>,
pub tenancy: Option<Tenancy>,
pub tls: Option<ListenerTlsConfig>,
pub max_conns: Option<usize>,
pub idle_timeout_ms: Option<u64>,
pub max_conn_duration_ms: Option<u64>,
}Expand description
[serve.listeners.<name>] — a host-owned inbound-TCP listener (PLAN-handler-tcp-inbound). The
node binds + listens + accepts on bind and dispatches each accepted connection to the guest
component’s tcp-connection-handler export, with tenancy OPERATOR-PINNED here (a raw socket
carries no Host/path/principal, so there is nothing per-connection to resolve). The guest is handed
only the connection’s wasi:io byte streams — it holds NO wasi:sockets authority (bind stays
host-side). Modeled on boatramp_core::function::FunctionConfig / the session route config.
Phase 1 is plaintext-only and no per-listener egress: a declared tls block or a non-empty
egress_allowlist is REFUSED at config load (fail-closed, boot-LOUD) rather than silently ignored —
per-listener host-TLS and outbound egress are deferred follow-ups. See [validate_listeners].
Fields§
§bind: Option<SocketAddr>The address the node binds + listens + accepts on (e.g. 0.0.0.0:9000). Required (a blank
bind is refused at config load).
component: StringPath to the guest .wasm within the pinned site’s deployment (exports tcp-connection-handler).
Required.
project: StringThe project this listener’s component is deployed under (host-resolved, never guest input). The
active deployment of project/site is what the accept loop serves. Required.
site: StringThe site within project whose active deployment holds component. Required.
imports: Vec<String>Requested capabilities (interface names; see KNOWN_IMPORTS). A listener component declares
whatever sql/orm/kv/… it uses per connection — NOT wasi:sockets (the host owns the
socket; a tcp-connection-host guest imports only wasi:io, handed the accepted streams).
env: BTreeMap<String, String>Static environment variables injected into the component (never secrets).
egress_allowlist: Vec<String>DEFERRED (Phase 1): a per-listener outbound-TCP allowlist. A tcp-connection-host guest imports
ONLY wasi:io — it cannot hold wasi:sockets — so this is unusable in Phase 1 and a non-empty
value is REFUSED at config load (fail-closed) rather than silently dropped. Kept for forward
parity with the handler/session egress_allowlist.
tenancy: Option<Tenancy>Operator-pinned Dimension-0 tenancy for this listener’s sql/orm (resolved once from this
config, carried on every connection — nothing per-connection to resolve from). Absent ⇒ plain
(project = database).
tls: Option<ListenerTlsConfig>DEFERRED (Phase 1): per-listener host-TLS. Phase 1 ships plaintext-only; a declared tls block
is REFUSED at config load (fail-closed) so an operator is never misled into thinking a listener
terminates TLS when it does not. Terminate TLS in front of boatramp, or wait for the fast-follow.
max_conns: Option<usize>Cap on simultaneously-live connections for THIS listener (a per-listener DoS bound on top of the
engine’s conn-lane ceiling). 0 is refused; absent ⇒ DEFAULT_LISTENER_MAX_CONNS.
idle_timeout_ms: Option<u64>Tear a connection down after this many milliseconds with NO bytes in either direction (idle
timeout — the conn lane replaces the per-invocation epoch deadline with this). 0 is refused;
absent ⇒ DEFAULT_LISTENER_IDLE_TIMEOUT_MS.
max_conn_duration_ms: Option<u64>Absolute cap (milliseconds) on a single connection’s lifetime regardless of activity. 0 is
refused; absent ⇒ DEFAULT_LISTENER_MAX_CONN_DURATION_MS.
Trait Implementations§
Source§impl Clone for ListenerConfig
impl Clone for ListenerConfig
Source§impl Debug for ListenerConfig
impl Debug for ListenerConfig
Source§impl Default for ListenerConfig
impl Default for ListenerConfig
Source§impl<'de> Deserialize<'de> for ListenerConfigwhere
ListenerConfig: Default,
impl<'de> Deserialize<'de> for ListenerConfigwhere
ListenerConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ListenerConfig
impl RefUnwindSafe for ListenerConfig
impl Send for ListenerConfig
impl Sync for ListenerConfig
impl Unpin for ListenerConfig
impl UnsafeUnpin for ListenerConfig
impl UnwindSafe for ListenerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more