Thruput TypeScript protocol bindings
    Preparing search index...

    Class WebSocketTransport

    WebSocket-based ONC-RPC transport.

    Each call sends one WebSocket binary message and waits for one reply. Suitable for browsers and Cloudflare Workers.

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Connect to an ONC-RPC WebSocket endpoint.

      Parameters

      • url: string

      Returns WebSocketTransport

    Methods

    • Send one encoded ONC-RPC call message and wait for the matching reply.

      Parameters

      • requestBytes: Uint8Array

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Close the WebSocket connection.

      Returns void