interface WebSocketOptions
Options for a WebSocket instance. This feature is non-standard.
Properties #
The sub-protocol(s) that the client would like to use, in order of preference.
#headers: HeadersInit
optional
A Headers object, an object literal, or an array of two-item arrays to set handshake's headers. This feature is non-standard.
An HttpClient
instance to use when creating the WebSocket connection.
This is useful when you need to connect through a proxy or customize TLS settings.
const client = Deno.createHttpClient({
proxy: {
transport: "unix",
path: "/path/to/socket",
},
});
const ws = new WebSocket("ws://localhost:8000/socket", { client });