Skip to main content

WebSocketConfig

Struct WebSocketConfig 

Source
pub struct WebSocketConfig {
Show 16 fields pub bind_addr: Option<String>, pub public_url: Option<String>, pub seed_urls: Vec<String>, pub path: Option<String>, pub mtu: Option<u16>, pub max_frame_bytes: Option<usize>, pub max_send_queue: Option<usize>, pub max_connections: Option<usize>, pub max_inbound_connections: Option<usize>, pub connect_timeout_ms: Option<u64>, pub key_hint_timeout_ms: Option<u64>, pub reconnect_initial_ms: Option<u64>, pub reconnect_max_ms: Option<u64>, pub ping_interval_secs: Option<u64>, pub idle_timeout_secs: Option<u64>, pub accept_connections: Option<bool>,
}
Expand description

WebSocket physical transport configuration.

The native listener intentionally speaks plain WebSocket so deployments can bind it to localhost or a private interface and terminate TLS in a reverse proxy. Clients use explicit wss:// seed URLs; plaintext ws:// seeds are accepted only for loopback development and tests. A bounded nonce/key-hint exchange identifies a URL-only seed before Noise IK; after that exchange, every binary WebSocket message carries exactly one bounded FIPS physical record.

Fields§

§bind_addr: Option<String>

Optional native plain-WS listener address. Unset means client-only.

§public_url: Option<String>

Public wss:// URL advertised for this listener, separate from bind.

§seed_urls: Vec<String>

One or more explicit first-adjacency seed URLs.

§path: Option<String>

HTTP path accepted by the native listener. Defaults to /fips.

§mtu: Option<u16>

Dataplane/path budget. Defaults to 1400 bytes.

§max_frame_bytes: Option<usize>

Maximum binary WebSocket message size.

§max_send_queue: Option<usize>

Maximum queued outbound records per connection.

§max_connections: Option<usize>

Maximum total WebSocket connections for this transport instance.

§max_inbound_connections: Option<usize>

Maximum simultaneous inbound WebSocket connections.

§connect_timeout_ms: Option<u64>

Outbound TCP/TLS/WebSocket connect timeout.

§key_hint_timeout_ms: Option<u64>

Time allowed for the untrusted seed-key hint exchange.

§reconnect_initial_ms: Option<u64>

Initial reconnect delay for configured seeds.

§reconnect_max_ms: Option<u64>

Maximum reconnect delay for configured seeds.

§ping_interval_secs: Option<u64>

WebSocket ping interval. Zero disables transport pings.

§idle_timeout_secs: Option<u64>

Close connections with no received frame for this long. Zero disables.

§accept_connections: Option<bool>

Accept fresh inbound Noise IK handshakes. Defaults to true whenever the transport has a listener or seed URL. WebSocket dial direction does not constrain FIPS session direction on an established routed adjacency.

Implementations§

Source§

impl WebSocketConfig

Source

pub fn path(&self) -> &str

Source

pub fn mtu(&self) -> u16

Source

pub fn max_frame_bytes(&self) -> usize

Source

pub fn max_send_queue(&self) -> usize

Source

pub fn max_connections(&self) -> usize

Source

pub fn max_inbound_connections(&self) -> usize

Source

pub fn connect_timeout_ms(&self) -> u64

Source

pub fn key_hint_timeout_ms(&self) -> u64

Source

pub fn reconnect_initial_ms(&self) -> u64

Source

pub fn reconnect_max_ms(&self) -> u64

Source

pub fn ping_interval_secs(&self) -> u64

Source

pub fn idle_timeout_secs(&self) -> u64

Source

pub fn accept_connections(&self) -> bool

Source

pub fn validate(&self) -> Result<(), String>

Trait Implementations§

Source§

impl Clone for WebSocketConfig

Source§

fn clone(&self) -> WebSocketConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebSocketConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WebSocketConfig

Source§

fn default() -> WebSocketConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WebSocketConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for WebSocketConfig

Source§

impl PartialEq for WebSocketConfig

Source§

fn eq(&self, other: &WebSocketConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WebSocketConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WebSocketConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more