Skip to content

Commit

Permalink
[] (0) Define the WebSocket protocol in more detail for servers.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3192 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 5, 2009
1 parent cf99432 commit b8da006
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index
Expand Up @@ -39,7 +39,7 @@
<div class=head>
<p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<h1>HTML 5</h1>
<h2 class="no-num no-toc" id=draft-standard-&mdash;-date:-01-jan-1901>Draft Standard &mdash; 4 June 2009</h2>
<h2 class="no-num no-toc" id=draft-standard-&mdash;-date:-01-jan-1901>Draft Standard &mdash; 5 June 2009</h2>
<p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<dl><dt>Multiple-page version:</dt>
Expand Down
24 changes: 17 additions & 7 deletions source
Expand Up @@ -70844,8 +70844,9 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<p>Send another CRLF pair (0x0d 0x0a).</p>

<p>Read (and discard) data from the client until four bytes 0x0d
0x0a 0x0d 0x0a are read.</p>
<p>Read data from the client until four bytes 0x0d 0x0a 0x0d 0x0a
are read. This data must either be discarded or handled as described
in the following section describing the handshake details.</p>

<p>If the connection isn't dropped at this point, go to the <a
href="#ws-sd-framing">data framing</a> section.</p>
Expand All @@ -70867,6 +70868,12 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>
title="">WebSocket-Location</code> line (after the appropriate
scheme and host).</p>

<p>If the first field does not have three tokens, the server should
abort the connection as it probably represents an errorneous
client.</p>

<hr>

<p>The remaining fields consist of name-value pairs, with the name
part separated from the value part by a colon and a space (bytes
0x3a 0x20). Of these, several are interesting:</p>
Expand Down Expand Up @@ -70920,6 +70927,9 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

</dl>

<p>Any fields that lack the colon-space separator should be
discarded and may cause the server to disconnect.</p>


<h6 id="ws-sd-framing">Data framing</h6>

Expand All @@ -70929,14 +70939,14 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>
requirements on user agents defined earlier handle any content
including possible future extensions to the protocols.</p>

<p>The server should run through the following steps to process the
<p>The server must run through the following steps to process the
bytes sent by the client:</p>

<ol>

<li><p>Read a byte from the client. Assuming everything is going
according to plan, it will be a 0x00 byte. Behavior for the server
is undefined if the byte is not 0x00.</p></li>
according to plan, it will be a 0x00 byte. If the byte is not a
0x00 byte, then the server may disconnect.</p></li>

<li><p>Let <var title="">raw data</var> be an empty byte
array.</p></li>
Expand All @@ -70949,7 +70959,7 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>
previous step (labeled <a href="#ws-sd-data"><i>data</i></a>).</p></li>

<li><p>Interpret <var title="">raw data</var> as a UTF-8 string,
and apply whatever server-specific processing should occur for the
and apply whatever server-specific processing is to occur for the
resulting string.</p>

<li><p>Return to the first step to read the next byte.</p></li>
Expand All @@ -70958,7 +70968,7 @@ Proxy-authorization: Basic ZWRuYW1vZGU6bm9jYXBlcyE=</pre>

<hr>

<p>The server should run through the following steps to send strings
<p>The server must run through the following steps to send strings
to the client:</p>

<ol>
Expand Down

0 comments on commit b8da006

Please sign in to comment.