undici icon indicating copy to clipboard operation
undici copied to clipboard

implement WebSocketStream

Open KhafraDev opened this issue 1 year ago • 4 comments

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])))
})

KhafraDev avatar Feb 07 '24 20:02 KhafraDev