Iskra API Reference
    Preparing search index...

    Interface SocketDriverOptions

    interface SocketDriverOptions {
        allowedEvents?: readonly string[];
        allowedOrigins?: readonly string[];
        authenticate?: Authenticate;
        canJoin?: CanJoin;
        canPublish?: CanPublish;
        maxPayloadLength?: number;
        port?: number;
        rateLimit?: number;
        rateWindowMs?: number;
        router?: SocketRouter;
    }
    Index
    allowedEvents?: readonly string[]

    Allowed fallback event names; when set, others are dropped.

    allowedOrigins?: readonly string[]

    Browser origins allowed to connect (exact match, e.g. "https://app.example.com"). A handshake with any other Origin is refused with 403, which blocks cross-site WebSocket hijacking; requests without an Origin (non-browser clients) are allowed. Default: any origin.

    authenticate?: Authenticate

    Authenticate the upgrade request (see Authenticate). Default: none.

    canJoin?: CanJoin

    Gate ctx.join; deny by returning false. Defaults to allow-all.

    canPublish?: CanPublish

    Gate ctx.broadcast; deny by returning false. Defaults to allow-all.

    maxPayloadLength?: number

    Max inbound frame size in bytes. Defaults to 16 KiB.

    port?: number

    Port to listen on. Defaults to 3001; 0 picks a free port (read it from driver.port).

    rateLimit?: number

    Max inbound messages per connection per window. Defaults to 100.

    rateWindowMs?: number

    Rate-limit window in ms. Defaults to 1000.

    router?: SocketRouter