From 7d61b485e47e247d7ecac500c83a902ab934f569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 16 Nov 2020 16:12:55 +0100 Subject: Update documentation --- docs/en/gun/2.0/guide/protocols/index.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'docs/en/gun/2.0/guide/protocols/index.html') diff --git a/docs/en/gun/2.0/guide/protocols/index.html b/docs/en/gun/2.0/guide/protocols/index.html index ef0c58fd..ccf854d0 100644 --- a/docs/en/gun/2.0/guide/protocols/index.html +++ b/docs/en/gun/2.0/guide/protocols/index.html @@ -76,11 +76,9 @@

The HTTP/2 interface is very similar to HTTP/1.1, so this section instead focuses on the differences in the interface for the two protocols.

Gun will send gun_push messages for every push received. They will always be sent before the gun_response message. They can be ignored safely if they are not needed, or they can be canceled.

The gun:cancel/2 function will use the HTTP/2 stream cancellation mechanism which allows Gun to inform the server to stop sending a response for this particular request, saving resources.

-

It is not currently possible to upgrade an HTTP/2 connection to Websocket. Support for this will be added in a future release.

Websocket

Websocket is a binary protocol built on top of HTTP that allows asynchronous concurrent communication between the client and the server. A Websocket server can push data to the client at any time.

-

Websocket is only available as a connection upgrade over an HTTP/1.1 connection.

-

Once the Websocket connection is established, the only operation available on this connection is sending Websocket frames using gun:ws_send/2.

+

Once the Websocket connection is established over an HTTP/1.1 connection, the only operation available on this connection is sending Websocket frames using gun:ws_send/3.

Gun will send a gun_ws message for every frame received.

Summary

The two following tables summarize the supported operations and the messages Gun sends depending on the connection's current protocol.

@@ -157,7 +155,7 @@ ws_upgrade yes -no +yes no ws_send @@ -204,7 +202,7 @@ gun_upgrade yes -no +yes no gun_ws -- cgit v1.2.3