Hosting t3 with websockets
Is there a simple hosting solution for running t3 app with websockets?
Vercel doesn't support websockets, if I understand the docs correctly.
8 Replies
fly.io maybe
railway.app too maybe
Pusher + Soketi on Railway (not using the template, its broken so you'd have to manually set it up) is pretty nice, Theo did a stream where he built zapdos using Pusher (https://github.com/pingdotgg/zapdos)
GitHub
GitHub - pingdotgg/zapdos
Contribute to pingdotgg/zapdos development by creating an account on GitHub.
@shineslove Do you have the link to the VOD?
My main goal is not to be dependent on a product, like pusher. I have everything working locally. Would be nice not to run it on run it on a custom VM.
Why don't you want to use a product like pusher?
There are also opensource and selfhostable products like https://soketi.app/ , that you can run locally.
Theo - t3․gg
YouTube
STREAM VOD: Theo's TERRIBLE at React (seriously I hate react 18 so ...
Also live on twitch: https://twitch.tv/theo
All my links: https://t3.gg/links
Discord: https://t3.gg/discord
The reason for not wanting to use pusher is vendor lock in and the ability for the apps that I'm developing to be self hosted, or hosted anywhere.
I've got everything up and running with tRPC and subscriptions on my local dev environment. Soketi looks like a fitting solution but it is not needed at the moment. It could be an option if the tRPC subscriptions are flaky or something like that. But the hosting issue still applies.
DO apps looks like they support websockets. Would have been nice both servers could be run on the same app, else I need to look into some infra for pub/sub between them, using EventEmiter at the moment.
Right now my options are. 2xDO apps with some pub/sub fixes or a Droplet with bunch of more infra to set up.
I'm using railway with a custom next server built atop express
But you don't necessarily need a custom server depending on the nature of the websocket updates