bun icon indicating copy to clipboard operation
bun copied to clipboard

WebSocket - close 1002 Protocol error - expected control frame

Open tim-smart opened this issue 2 years ago • 3 comments

What version of Bun is running?

0.3.0

What platform is your computer?

Darwin 22.1.0 x86_64 i386

What steps can reproduce the bug?

const ws = new WebSocket("wss://gateway.discord.gg/?version=10&encoding=json")

ws.addEventListener("open", () => {
  console.log("open")
})

ws.addEventListener("message", (e) => {
  console.log("message", e.data)
})

ws.addEventListener("error", (e) => {
  console.log("error", e)
})

ws.addEventListener("close", (e) => {
  console.log("close", e.code, e.reason)
})

What is the expected behavior?

No response

What do you see instead?

image

Additional information

No response

tim-smart avatar Dec 09 '22 00:12 tim-smart

Confirmed by me.

xhyrom avatar Dec 30 '22 13:12 xhyrom

Doesn't seem to repro on my home internet on either macOS aarch64 or Linux x64

Will try more configurations

Jarred-Sumner avatar Dec 30 '22 13:12 Jarred-Sumner

It happens me when i connect like 10 accounts to discord gateway.

xhyrom avatar Dec 30 '22 15:12 xhyrom

We need to test our WebSocket client using the Autobahn test suite to fix these bugs, including this one. For updates, please upvote and subscribe to this issue: https://github.com/oven-sh/bun/issues/6686

Electroid avatar Oct 24 '23 13:10 Electroid