|
I am trying to build an IM application on Nuxt. I really like the subscription/publishing of Crossws, but in Nuxt, the parameters required for definaeWebSocketHandler and definaeWebSocket are the same as the Hook of the adapter. And I couldn't find any external way to publish new messages to the channel on nuxt. // in crossws
import crossws from "crossws/adapters/bun";
const ws = crossws({
hooks: {
message: console.log,
},
});
// This is feasible
ws.publish('channel', ‘data’)In summary, I am unable to find publish in the context of Nuxt and cannot combine crossws with Nuxt Perhaps I need to raise this issue on nuxt. |
Answered by
pi0
Mar 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allowing access to global sockets will be available in Nitro v3 and Nuxt v4.