Skip to content
CCPEDIAby Unity Nodes
App Development

How to implement subprotocol in my .net Application

3 posts311 views3 likesLast activity Apr 2022

  1. Iqra_Mustafa1OP

    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

  2. Mate_Varga 3

    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

  3. Iqra_Mustafa1

    Thanks for the help. It worked.