[html5] r3497 - [e] (0) Add a section introducing the actual protocol.
whatwg at whatwg.org
whatwg at whatwg.org
Wed Jul 29 16:38:22 PDT 2009
Author: ianh
Date: 2009-07-29 16:38:21 -0700 (Wed, 29 Jul 2009)
New Revision: 3497
Modified:
source
Log:
[e] (0) Add a section introducing the actual protocol.
Modified: source
===================================================================
--- source 2009-07-29 23:09:17 UTC (rev 3496)
+++ source 2009-07-29 23:38:21 UTC (rev 3497)
@@ -70049,6 +70049,8 @@
<h5>Introduction</h5>
+ <p><i>This section is non-normative.</i></p>
+
<p>The Web Socket protocol is designed on the principle that there
should be minimal framing (the only framing that exists is to make
the protocol frame-based instead of stream-based, and to support a
@@ -70072,6 +70074,8 @@
<h6>Security model</h6>
+ <p><i>This section is non-normative.</i></p>
+
<p>The Web Socket protocol uses the origin model used by Web
browsers to restrict which Web pages can contact a Web Socket server
when the Web Socket protocol is used from a Web page. Naturally,
@@ -70082,10 +70086,12 @@
<h6>Relationship to TCP/IP and HTTP</h6>
- <p>The Web Socket protocol is an independent TCP-based
- protocol. It's only relationship to HTTP is that its handshake is
- interpreted by HTTP servers as an Upgrade request.</p>
+ <p><i>This section is non-normative.</i></p>
+ <p>The Web Socket protocol is an independent TCP-based protocol. Its
+ only relationship to HTTP is that its handshake is interpreted by
+ HTTP servers as an Upgrade request.</p>
+
<p>The Web Socket protocol by default uses port 81 for regular
Web Socket connections and port 815 for Web Socket connections
tunneled over TLS.</p>
@@ -70093,6 +70099,8 @@
<h6>Establishing a connection</h6>
+ <p><i>This section is non-normative.</i></p>
+
<p>There are several options for establishing a Web Socket connection.</p>
<p>The simplest method is to use port 81 to get a direct connection
@@ -70127,7 +70135,43 @@
HTTP servers is probably easier to manage.</p>
+ <h6>The Web Socket protocol</h6>
+ <p><i>This section is non-normative.</i></p>
+
+ <p>The protocol has two parts: a handshake, and then the data
+ transfer.</p>
+
+ <p>The handshake from the client looks as follows:</p>
+
+ <pre>GET /demo HTTP/1.1
+Upgrade: WebSocket
+Connection: Upgrade
+Host: example.com
+Origin: http://example.com
+WebSocket-Protocol: sample</pre>
+
+ <p>The handshake from the server looks as follows:</p>
+
+ <pre>HTTP/1.1 101 Web Socket Protocol Handshake
+Upgrade: WebSocket
+Connection: Upgrade
+WebSocket-Origin: http://example.com
+WebSocket-Location: ws://example.com/demo
+WebSocket-Protocol: sample</pre>
+
+ <p>Once the client and server have both sent their handshakes, and
+ if the handshake was successful, then the data transfer part
+ starts. This is a two-way communication channel where each side can,
+ independently from the other, send data at will.</p>
+
+ <p>Data is sent in the form of UTF-8 text. Each frame of data starts
+ with a 0x00 byte and ends with a 0xFF byte, with the UTF-8 text in
+ between.</p>
+
+
+
+
<!--BOILERPLATE middle-ietf-conformance-->
More information about the Commit-Watchers
mailing list