Environment
node
Reproduction
I am using Elysia as a handler inside Nitro. I enabled WebSocket support in Elysia and the WebSocket connection can be established successfully, but the Elysia WebSocket handler is never executed.
Environment
- Nitro version:
- Elysia version:
- Runtime: Bun
- OS:
Reproduction
Elysia app:
import { Elysia } from 'elysia'
import { websocket } from 'elysia/websocket'
export const app = new Elysia()
.use(websocket())
.ws('/ws', function* () {
console.log('handler entered')
yield 1
yield 2
yield 3
})
Nitro config:
export default defineNitroConfig({
features: {
websocket: true
}
})
Client:
const ws = new WebSocket('ws://localhost:3000/ws')
ws.onopen = () => {
console.log('connected')
}
ws.onmessage = (event) => {
console.log(event.data)
}
Expected behavior
After the WebSocket connection is established, the Elysia WebSocket handler should be executed:
connected
handler entered
1
2
3
Actual behavior
The WebSocket handshake succeeds:
WebSocket connection established
but the Elysia handler is never entered:
No error is thrown.
Describe the bug
none
Additional context
No response
Logs
Environment
node
Reproduction
I am using Elysia as a handler inside Nitro. I enabled WebSocket support in Elysia and the WebSocket connection can be established successfully, but the Elysia WebSocket handler is never executed.
Environment
Reproduction
Elysia app:
Nitro config:
Client:
Expected behavior
After the WebSocket connection is established, the Elysia WebSocket handler should be executed:
Actual behavior
The WebSocket handshake succeeds:
but the Elysia handler is never entered:
No error is thrown.
Describe the bug
none
Additional context
No response
Logs