You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
If I run the attached example websocket.zip with nodejs it works:
$ node server.js
Thu Mar 07 2024 09:39:55 GMT+0000 (Coordinated Universal Time) Server is listening on port 8080
Thu Mar 07 2024 09:40:13 GMT+0000 (Coordinated Universal Time) Connection accepted.
Received Message: 397030
Received Message: 10038402
Received Message: 6845227
Received Message: 2955012
Received Message: 5366268
Received Message: 4668963
$ bun server.js
Thu Mar 07 2024 09:52:10 GMT+0000 (Coordinated Universal Time) Server is listening on port 8080
Thu Mar 07 2024 09:52:15 GMT+0000 (Coordinated Universal Time) Connection accepted.
$ bun client.js
Same result if I also use nodejs for the client part.
Any idea?
Probably not related to this issue but I also tried nodejs for the server and bun for the client and following error occurs (I have added headers dump in the log trace):
$ node server.js
Thu Mar 07 2024 10:00:12 GMT+0000 (Coordinated Universal Time) Server is listening on port 8080
Thu Mar 07 2024 10:00:17 GMT+0000 (Coordinated Universal Time) Received request for / with headers {"host":"localhost:8080","sec-websocket-key":"ku8AfoxHZGmLPCmPCxoxlQ==","sec-websocket-protocol":"echo-protocol","sec-websocket-version":"13","upgrade":"websocket","connection":"keep-alive","user-agent":"Bun/1.0.30","accept":"*/*"}
$ bun client.js
Connect Error: Error: Server responded with a non-101 status: 404 Not Found
Response Headers Follow:
date: Thu, 07 Mar 2024 09:54:38 GMT
connection: keep-alive
keep-alive: timeout=5
transfer-encoding: chunked
The text was updated successfully, but these errors were encountered:
Thanks for the report! I haven't tried Bun before. It's likely that there's some API in the http(s) modules that they didn't replicate exactly and its tripping up some expectation in WebSocket-Node. I don't have a lot of time at the moment to dig into it, unfortunately. :-(
So one of the nice things about Bun is the websocket client/server is natively supported, and using highly performant uWebsockets. The client construct is very similar but the server is very different (although not hard to refactor). Also supports native pub/sub capability.
Hi,
If I run the attached example websocket.zip with nodejs it works:
, but with bun it doesn't:
$ bun client.js
Same result if I also use nodejs for the client part.
Any idea?
Probably not related to this issue but I also tried nodejs for the server and bun for the client and following error occurs (I have added headers dump in the log trace):
The text was updated successfully, but these errors were encountered: