wobsoriano / trpc-nuxt

End-to-end typesafe APIs in Nuxt applications.
trpc-nuxt.vercel.app
MIT License
687 stars 39 forks source link

Websocket support #156

Closed Q16solver closed 9 months ago

Q16solver commented 9 months ago

Just saw a tweet about how nuxt currently supports websockets! I'm not sure if there is a good standard way of hooking up to it with trpc, but maybe we could get some guidance/support on this, thanks!

Related docs: https://nitro.unjs.io/guide/websocket

wobsoriano commented 9 months ago

This is the existing demo without the new websockets feature.

I looked into nitro websocket and I think it's easy to implement as long as we have access to the websocket object since it's required in the applyWSSHandler function when creating a WS server in tRPC.