Package 

Class StreamSocketConfig


  • 
    public final class StreamSocketConfig
    
                        

    Configuration for the Stream WebSocket connection.

    Holds both identity (URL, API key, auth type) and operational tunables (health check timing, event aggregation, connection timeout). Products pass this to the StreamClient factory to describe their socket.

    // Coordinator socket — standard timing
    val coordinatorSocket = StreamSocketConfig.jwt(
        url = StreamWsUrl.fromString("wss://chat.stream-io-api.com/connect"),
        apiKey = apiKey,
        clientInfoHeader = clientInfo,
    )
    
    // SFU socket — aggressive timing, low aggregation threshold
    val sfuSocket = StreamSocketConfig.jwt(
        url = StreamWsUrl.fromString("wss://sfu.stream-io-api.com"),
        apiKey = apiKey,
        clientInfoHeader = clientInfo,
        healthCheckIntervalMs = 5_000,
        livenessThresholdMs = 15_000,
        connectionTimeoutMs = 2_000,
        aggregationThreshold = 10,
        aggregationMaxWindowMs = 200,
    )