How do I deploy express server with y-websocket? I am using the same configuration I use on local machine. I tried deploying to Railway, but it seems that I can’t connect to it.
{
"start": "node build/index.js & y-websocket"
}
I think this has to do something with the HOST option in the y-websocket cli. If so, what should be the value of the HOST option?
Yes. You just have to make sure the HOST and PORT are correct for your web server setup.
Looks fine to me. You can also copy server.js and build your own server based on that. It involves calling setupWSConnection when the websocket connects:
@wwyomwzp just to highlight that authN bit that Raine pointed out is the important and slightly tricky bit to get your head around if you aren’t familiar with websockets. There’s no built in authN/Z support for WS. It’s great that Raine has shared y-websocket-auth.