websock-proto 0.1.0

Protocol-level primitives shared across websock transports.
Documentation
/// Connection configuration shared by native and WebAssembly transports.
#[derive(Debug, Clone, Default)]
pub struct ConnectOptions {
    /// Requested subprotocols (e.g. "json", "cbor").
    pub protocols: Vec<String>,

    /// Additional headers (native only). Browser WebSockets typically ignore these by design.
    pub headers: Vec<(String, String)>,
}

/// Server configuration shared by native transports.
#[derive(Debug, Clone, Default)]
pub struct ServerOptions {
    /// Accepted subprotocols (e.g. "json", "cbor").
    pub protocols: Vec<String>,

    /// Additional response headers (native only).
    pub headers: Vec<(String, String)>,
}