Marfusios/websocket-client

Can this handle channel subscribing like Phoenix js

Cookiezzz opened this issue · 1 comments

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

yes you can.

async Task JoinChannel(ClientWebSocket webSocket, string channelName)
{
    string joinMessage = $"{{\"topic\":\"{channelName}\",\"event\":\"phx_join\",\"payload\":{{}},\"ref\":\"1\"}}";

    await SendMessage(webSocket, joinMessage);
}