-
-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSockets In Bun #2696
Comments
@NicoPlyley Thank you for raising the issue. @nakasyou Could you see this? |
Hi @NicoPlyley, thank you for sending. I think it's the same cause as this: #2645. If WebSocket helper will support |
@NicoPlyley return app.fetch(req, { ip: server.requestIP(req), server }) to resolve it. |
The new connInfo should solve it too, correct? I'm basing my issue based off what people on discord have had issues with |
@NicoPlyley return app.fetch(req, { ip: server.requestIP(req), server }) |
What version of Hono are you using?
4.3.7
What runtime/platform is your app running on?
Bun
What steps can reproduce the bug?
If you
Bun.serve
and returnapp.fetch()
it will not allow Bun to switch protocols, making web sockets unusable. The following is an example of thatNow that is expected behavior in Bun, so here is how Bun says it should be done instead:
What is the expected behavior?
No response
What do you see instead?
This appears to be because since the
server.upgrade
was already ran, it is causing issues.Here is the error that is received:
Additional information
I've had two different people mention this issue, so I decided to investigate further. I think it is important and reasonable, for a user to need to access the IP, or set any env and be able to still use websockets
The text was updated successfully, but these errors were encountered: