Skip to content
Discussions/App Development/How to implement subprotocol in my .net ApplicationForum ↗

How to implement subprotocol in my .net Application

App Development3 posts299 views3 likesLast activity Apr 2022
IQ
Iqra_Mustafa1OP
Apr 2022

I want to add the subprotocol in my client web socket. I try to do it in


many other ways. but fail to do so. If anyone can help with it.
WhatsApp Image 2022-04-23 at 1.34.08 PM

MA
Mate_Varga
Apr 2022

Hi @Iqra_Mustafa1

Subprotocols should not be appended to the URI. You should add them with AddSubProtocol method to ClientWebSocketOptions which you can access through the Options property of your ClientWebSocket instance. Since subprotocols are negotiated during handshake, please make sure you add subprotocols before you connect.

Hope this helps,
Mate

IQ
Iqra_Mustafa1
Apr 2022

Thanks for the help. It worked.

← Back to Discussions