Deployed 8fda7cb
with MkDocs version: 1.0.4
This commit is contained in:
@ -258,6 +258,16 @@ headers["foo"] = "bar";
|
||||
webSocket.setExtraHeaders(headers);
|
||||
</code></pre>
|
||||
|
||||
<h3 id="subprotocols">Subprotocols</h3>
|
||||
<p>You can specify subprotocols to be set during the WebSocket handshake. For more info you can refer to <a href="https://hpbn.co/websocket/#subprotocol-negotiation">this doc</a>.</p>
|
||||
<pre><code>webSocket.addSubprotocol("appProtocol-v1");
|
||||
webSocket.addSubprotocol("appProtocol-v2");
|
||||
</code></pre>
|
||||
|
||||
<p>The protocol that the server did accept is available in the open info <code>protocol</code> field.</p>
|
||||
<pre><code>std::cout << "protocol: " << msg->openInfo.protocol << std::endl;
|
||||
</code></pre>
|
||||
|
||||
<h3 id="automatic-reconnection">Automatic reconnection</h3>
|
||||
<p>Automatic reconnection kicks in when the connection is disconnected without the user consent. This feature is on by default and can be turned off.</p>
|
||||
<pre><code>webSocket.enableAutomaticReconnection(); // turn on
|
||||
|
Reference in New Issue
Block a user