oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.7k stars 2.72k forks source link

Bun cannot not proxy websocket requests #14522

Open evantahler opened 2 hours ago

evantahler commented 2 hours ago

What version of Bun is running?

1.1.30

What platform is your computer?

Darwin 24.0.0 arm64 arm (MacOS Sequoia + M1)

What steps can reproduce the bug?

I'd like to use bun to build a dynamic proxy for HTTP and WS requests. HTTP requests proxy fine, but websockets always seem to 'hang'.

You can see this directly with the node-http-proxy examples:

  1. Download the repo (git clone git@github.com:http-party/node-http-proxy.git
  2. install deps (cd examples && bun install)
  3. Run one of the examples (e.g. https://github.com/http-party/node-http-proxy/blob/master/examples/websocket/standalone-websocket-proxy.js) - bun run websocket/standalone-websocket-proxy.js - see that you never see the response messages

What is the expected behavior?

Websocket requests can be proxied.

What do you see instead?

... nothing. The requests just hang.

Additional information

No response

evantahler commented 2 hours ago

Re: https://github.com/oven-sh/bun/issues/10441 - I believe this to be a more general error about websockets + bun, not limited to Vite.