-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can not access globalThis.__io #12
Comments
Sorry for not clearly, I mean I want to use globalThis.__io in development environment. But I see this code in file server.ts
Can you point me how to use it. |
I found this aswell. I have no clue why its only set to run this code while in production and not in development |
Is it possible to access the socket from middlewares so that it can be attached to the context? |
You would have to set your .env.NODE_ENV = 'production' However. Nitro seems to have issues with websockets, it doesnt allow new connections after 6 clients has connected even if some of them disconnect. I would recommend following this thread as it seems like Nitro is working on websockets support. |
When I access globalThis.__io, it always return undefined.
How can I fix it ?
Thank you for supporting.
Additional, I use environment io.to(roomId).emit('function') to send message to specific room in socket.
I think we need to guide to use it.
The text was updated successfully, but these errors were encountered: