@nats-io/nats-core
    Preparing search index...

    Type Alias WsSocketFactory

    WsSocketFactory: (
        u: string,
        opts: ConnectionOptions,
    ) => Promise<{ socket: WebSocket }>

    WsSocketFactory is a factory that returns a WebSocket. Client code is responsible for creating a W3C WebSocket compliant transport. Whether the connection is encrypted is taken from the socket's url.

    Type Declaration

      • (u: string, opts: ConnectionOptions): Promise<{ socket: WebSocket }>
      • Parameters

        Returns Promise<{ socket: WebSocket }>

        a promise that resolves to a WebSocket