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
{{ message }}
Repository navigation
Access to root server on 'listen' hook for websocket setup #101
nuxt.hook('listen',(server)=>{// server is not the root server, but it's a proxified server handled by nuxi.// unable to do this :server.on('upgrade',(req,socket,head)=>{// handle socket// socket.write(...) does nothing});});
Describe the bug
With nuxt 3.7 :
Since nuxi create a proxy for handle only web request beetween root server and devServer, we are unable to attach websockets to the root server.
The server in listen hook is not the root server (listening on localhost:3000), but the devServer (listening on localhost:xxxxx).
Websocket must be attached on the root server for working, because proxy create by nuxi proxify only the web requests.
Activity
[-]Access to root server on 'listen' hool[/-][+]Access to root server on 'listen' hook[/+][-]Access to root server on 'listen' hook[/-][+]Access to root server on 'listen' hook for websocket setup[/+]pi0 commentedon Aug 30, 2023
Hi. A fix is released in v3.7.3. Check out this example for usage.