Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kubernetes_apis/deps.ts>tunnelBeta.WebsocketTunnel

REST focused Typescript classes for Kubernetes APIs, and tools for generating API interfaces
Latest
class tunnelBeta.WebsocketTunnel
implements KubernetesTunnel
import { tunnelBeta } from "https://deno.land/x/kubernetes_apis@v0.5.3/deps.ts";
const { WebsocketTunnel } = tunnelBeta;

Handles an individual WebSocket connection to the Kubernetes API. Kubernetes WebSockets support up to 255 indexed bytestreams. To send or receive data, you must first provide the channel's index, and then streams will be returned for that particular index.

WebSocket channels do not support closing individual streams. You must disconnect the overall tunnel if you wish to end things.

Constructors

new
WebsocketTunnel(wss: WebSocketStream, wssConn: WebSocketConnection)

Properties

private
downstreamChannels: Map<number, WritableStreamDefaultWriter<Uint8Array>>
private
upstreamChannels
readonly
done: Promise<void>
readonly
subProtocol: string
readonly
transportProtocol: string

Methods

getChannel<Treadable extends boolean, Twritable extends boolean>(opts: { spdyHeaders?: Record<string, string | number> | undefined; streamIndex?: number | undefined; readable: Treadable; writable: Twritable; })
ready(): Promise<void>