Can this handle channel subscribing like Phoenix js
Cookiezzz opened this issue · 1 comments
Cookiezzz commented
Hi there.
Awesome library. Use it for a simple websocket and works great!
Now I see in the help files you talk about channels and subscribing but I don't see the actual way on how to.
Is it possible to subscribe to channels in a web socket like Phoenix does?
https://hexdocs.pm/phoenix/js/index.html
marek-petak commented
yes you can.
async Task JoinChannel(ClientWebSocket webSocket, string channelName)
{
string joinMessage = $"{{\"topic\":\"{channelName}\",\"event\":\"phx_join\",\"payload\":{{}},\"ref\":\"1\"}}";
await SendMessage(webSocket, joinMessage);
}