undici
undici copied to clipboard
implement WebSocketStream
https://whatpr.org/websockets/48/7b748d3...7b81f79.html#the-websocketstream-interface
Now that the spec has been written, it's time to add it.
const ws = new WebSocketStream(`wss://my.websocket.server`)
ws.opened.then((init) => {
const writer = init.writable.getWriter()
writer.ready.then(() => writer.write(Buffer.from([65, 66, 67])))
})