summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.0/guide/ws_protocol.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-03-28 15:36:42 +0200
committerLoïc Hoguin <[email protected]>2016-03-28 15:36:42 +0200
commitfe3492a98de29942477b061cd02c92246f4bf85a (patch)
tree2255b796a657e6e4dfb72beec1141258d17f1220 /docs/en/cowboy/2.0/guide/ws_protocol.asciidoc
downloadninenines.eu-fe3492a98de29942477b061cd02c92246f4bf85a.tar.gz
ninenines.eu-fe3492a98de29942477b061cd02c92246f4bf85a.tar.bz2
ninenines.eu-fe3492a98de29942477b061cd02c92246f4bf85a.zip
Initial commit, new website system
Diffstat (limited to 'docs/en/cowboy/2.0/guide/ws_protocol.asciidoc')
-rw-r--r--docs/en/cowboy/2.0/guide/ws_protocol.asciidoc43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/en/cowboy/2.0/guide/ws_protocol.asciidoc b/docs/en/cowboy/2.0/guide/ws_protocol.asciidoc
new file mode 100644
index 00000000..67b2cdf2
--- /dev/null
+++ b/docs/en/cowboy/2.0/guide/ws_protocol.asciidoc
@@ -0,0 +1,43 @@
+[[ws_protocol]]
+== The Websocket protocol
+
+This chapter explains what Websocket is and why it is
+a vital component of soft realtime Web applications.
+
+=== Description
+
+Websocket is an extension to HTTP that emulates plain TCP
+connections between the client, typically a Web browser,
+and the server. It uses the HTTP Upgrade mechanism to
+establish the connection.
+
+Websocket connections are asynchronous, unlike HTTP. This
+means that not only can the client send frames to the server
+at any time, but the server can also send frames to the client
+without the client initiating anything other than the
+Websocket connection itself. This allows the server to push
+data to the client directly.
+
+Websocket is an IETF standard. Cowboy supports the standard
+and all drafts that were previously implemented by browsers,
+excluding the initial flawed draft sometimes known as
+"version 0".
+
+=== Implementation
+
+Cowboy implements Websocket as a protocol upgrade. Once the
+upgrade is performed from the `init/2` callback, Cowboy
+switches to Websocket. Please consult the next chapter for
+more information on initiating and handling Websocket
+connections.
+
+The implementation of Websocket in Cowboy is validated using
+the Autobahn test suite, which is an extensive suite of tests
+covering all aspects of the protocol. Cowboy passes the
+suite with 100% success, including all optional tests.
+
+Cowboy's Websocket implementation also includes the
+x-webkit-deflate-frame compression draft which is being used
+by some browsers to reduce the size of data being transmitted.
+Cowboy will automatically use compression as long as the
+`compress` protocol option is set when starting the listener.