diff options
Diffstat (limited to 'docs/en/gun/1.3/guide/websocket/index.html')
-rw-r--r-- | docs/en/gun/1.3/guide/websocket/index.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/en/gun/1.3/guide/websocket/index.html b/docs/en/gun/1.3/guide/websocket/index.html index 30f80e3f..4c2ad4ec 100644 --- a/docs/en/gun/1.3/guide/websocket/index.html +++ b/docs/en/gun/1.3/guide/websocket/index.html @@ -68,7 +68,7 @@ <p>Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS.</p> <p>You must use the <code>gun:ws_upgrade/2,3,4</code> function to upgrade to Websocket. This function can be called anytime after connection, so you can send HTTP requests before upgrading to Websocket.</p> <div class="listingblock"><div class="title">Upgrade to Websocket</div> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -76,7 +76,7 @@ http://www.gnu.org/software/src-highlite --> </div></div> <p>Gun will set all the necessary headers for performing the Websocket upgrade, but you can specify additional headers if needed. For example you can authenticate.</p> <div class="listingblock"><div class="title">Upgrade to Websocket using HTTP authentication</div> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite --> <p>You can pass the Websocket options as part of the <code>gun:open/2,3</code> call when opening the connection, or using the <code>gun:ws_upgrade/4</code>. The fourth argument is those same options.</p> <p>Gun can negotiate the protocol to be used for the Websocket connection. The <code>protocols</code> option can be given with a list of protocols accepted and the corresponding handler module. Note that the interface for handler modules is currently undocumented and must be set to <code>gun_ws_h</code>.</p> <div class="listingblock"><div class="title">Upgrade to Websocket with protocol negotiation</div> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -97,7 +97,7 @@ http://www.gnu.org/software/src-highlite --> <p>The upgrade will fail if the server cannot satisfy the protocol negotiation.</p> <p>When the upgrade succeeds, a <code>gun_upgrade</code> message is sent. If the server does not understand Websocket or refused the upgrade, a <code>gun_response</code> message is sent. If Gun couldn't perform the upgrade due to an error (for example attempting to upgrade to Websocket on an HTTP/1.0 connection) then a <code>gun_error</code> message is sent.</p> <p>When the server does not understand Websocket, it may send a meaningful response which should be processed. In the following example we however ignore it:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -117,7 +117,7 @@ http://www.gnu.org/software/src-highlite --> <p>Once the Websocket upgrade has completed successfully, you no longer have access to functions for performing requests. You can only send and receive Websocket messages.</p> <p>Use <code>gun:ws_send/2</code> to send messages to the server.</p> <div class="listingblock"><div class="title">Send a text frame</div> -<div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -137,7 +137,7 @@ http://www.gnu.org/software/src-highlite --> <p>Note that if you send a close frame, Gun will close the connection cleanly but will attempt to reconnect afterwards.</p> <h2 id="_receiving_data">Receiving data</h2> <p>Gun sends an Erlang message to the owner process for every Websocket message it receives.</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> |