Use DotJS(nuget) for c# / js interop without blazor. Vibe is built on it. It uses another library - Constellations(nuget) to set up a Websocket connection. Be advised: To use secure websockets( wss://) you need to add an X509Cert to your Constellation when setting it up for https://. Websockets defaults to wss:// when using https://. All messaging between browser and client is already encrypted with your own keys. DotJS allows you to set user specific keys that terminate when the connection closes. No wasm necessary.