joshua-mo-143 / react-websocket-chat-rust

27 stars 6 forks source link

exposing `wss://` endpoint instead of `http://` (noob seeking advice) #1

Open hobo1618 opened 1 year ago

hobo1618 commented 1 year ago

Hello hello, Loving working with shuttle so far and following these tutorials. I got everything working and deployed, but I have sort-of-related question that I'm having difficulty researching. I'm using a library (yjs) that requires a ws:// URI on the client, but this example only exposes an http endpoint. Any ideas on how I would go about changing the code to expose a ws:// or wss:// endpoint? Or if the solution isn't related to the code, any ideas where I could read more about this? Thanks so much!

joshua-mo-143 commented 1 year ago

Hey, thanks for opening the issue! I meant to respond to this earlier but forgot about it.

I'd suggest looking into tokio-tungstenite for this. I'm not sure if it's possible to do it with axum-tungstenite because it's mainly for routing and not exposing websocket endpoints.

hobo1618 commented 1 year ago

thanks! I'll look into this.