"Standard" version numbers are subject to the "IETF Review" IANA registration policy [RFC5226].ここで指定される符号化法は、各~終端値が符号化される際の~bit数が,各~fieldごとに異なり得るものとして指定される、~binary符号化法である。◎Here, the specified encoding is a binary encoding where each terminal value is encoded in the specified number of bits, which varies for each field.~serverは、着信~接続の受容を選ぶ場合、以下を指示する妥当な~HTTP応答で返信しなければナラナイ:◎If the server chooses to accept the incoming connection, it MUST reply with a valid HTTP response indicating the following.~WebSocket~Protocolは、~TCPに基づく,独立な~protocolである。その~HTTPとの関係性は、その~handshakeが~HTTP~serverからは`~Upgrade$要請として解釈される点に限られている。◎The WebSocket Protocol is an independent TCP-based protocol. To do so, the client MUST _Fail the WebSocket Connection_ as defined in Section 7.1.7.~algoまたは特定の手続きとして記される適合性の要件は、最終的な結果が等価になるのであれば,どう実装されてもヨイ。特に,この仕様で定義される~algoは、処理能より追い易さが意図されている。◎Conformance requirements phrased as algorithms or specific steps MAY be implemented in any manner, so long as the end result is equivalent. Such assumptions don't hold true in the case of a more-capable client.~WebSocket~Protocolが~web~pageから利用される際に,~WebSocket~serverに接触できる~web~pageを制約するため、~WebSocket~Protocolでは,~web~browserが利用している生成元( `origin^en )~modelを採用している。当然,~WebSocket~Protocolが専用の~clientから直に利用される場合(すなわち,~web~browserを通した~web~pageからではなく)、~clientは任意の生成元~文字列を供せるので,生成元~modelは有用にならない。◎The WebSocket Protocol uses the origin model used by web browsers to restrict which web pages can contact a WebSocket server when the WebSocket Protocol is used from a web page. It is used to mask the "Payload data" defined in the same section as frame-payload-data, which includes "Extension data" and "Application data".`Origin^h ~headerは、概して,信用できる~clientの文脈の下で実行されている~JS~appの作者が 信用できない主体であるときの 攻撃~事例から保護する。【!*】~client自身は、~serverと接触することができ,`Origin^h ~headerの仕組みにより,その種の通信~特権を~JS~appにまで広げるかどうかを決定する。その意図は、非~browserによる接続の確立ngを防止するのではなく、信用できる~browserが潜在的に悪意的な~JSの制御~下にあっても,~WebSocket~handshakeを捏造できなくする所にある。◎The |Origin| header field protects from the attack cases when the untrusted party is typically the author of a JavaScript application that is executing in the context of the trusted client.
This is primarily achieved by requiring that the server prove that it read the handshake, which it can only do if the handshake contains the appropriate parts, which can only be sent by a WebSocket client. The value of this header field MUST be 13.~clientから~serverへ送信される `Close$fr ~frameは、 `5.3$secに従って~maskされなければならない。◎Close frames sent from client to server must be masked as per Section 5.3.~proxy自動設定~script目的で渡される~URIは、`3$secの~WebSocket~URIの定義に従って,%~host, %~port, %~resource名, %~secure~flagから構築されていなければナラナイ。◎For the purpose of proxy autoconfiguration scripts, the URI to pass the function MUST be constructed from /host/, /port/, /resource name/, and the /secure/ flag using the definition of a WebSocket URI as given in Section 3.【この節の他の内容は、`11.3$secに集約。】◎This section describes a header field registered in the Permanent Message Header Field Names registry [RFC3864].◎Header field name• Sec-WebSocket-ProtocolApplicable protocol• httpStatus• standardAuthor/Change controller• IETFSpecification document(s)• RFC 6455Related information• This header field is only used for the WebSocket opening handshake.%~secure~flag が ~T の場合、接続を~openした後, ~handshake~data `RFC2818$r を送信する前までに,その接続~越しに~TLS~handshakeを— その Server Name Indication 拡張 `RFC6066$r を利用する下で —遂行する:[より高い~version番号が より低い~version番号と後方-互換になる]とする必要は、期待されていないことに注意。◎Note that there is no expectation that higher version numbers are necessarily backward compatible with lower version numbers.~passwordがある場合の接続は次のようになろう:◎If there was a password, the connection might look like:これを防止するため、~clientは、この節で述べたような異常な~closureが起きた後に再接続を試行する際には,何らかの形の~backoffを利用するベキである。【! backoff http://www.atmarkit.co.jp/fwin2k/network/tcpip006/tcpip04.html】◎To prevent this, clients SHOULD use some form of backoff when trying to reconnect after abnormal closures as described in this section.実装が~WebSocket~Protocolの一部として,`~dataを送信する$必要が生じた際は、実際の伝送は任意に遅延してもヨイ。例えば、より少数の~IP~packetで送信するために~dataを~bufferするなど。◎When an implementation is required to _send_ data as part of the WebSocket Protocol, the implementation MAY delay the actual transmission arbitrarily, e.g., buffering data so as to send fewer IP packets.~HTTP~serverと共有されている~portに接続が~~設けられる場合(~port 80 / 443 への流通ではごく普通に生じ得る状況)、その接続は,~HTTP~serverからは`~Upgrade$の申し出を伴う定例の `GET$hm 要請に見えることになる。~IP~addressが 1 個だけで, すべての流通が単独の~host名の単独の~serverと行き交うような,比較的~単純な設置においては、これは,配備されることになる~WebSocket~Protocolに基づく~systemにとり, 実用的な仕方になり得る。より精巧な(例えば,負荷分散装置や複数の~serverを伴う)設置においては、~HTTP~serverから分離された,~WebSocket接続~専用の~hostたちを~~用意する方が、おそらく管理し易いものになる。この仕様が書かれた時点では、~port 80 上と 443 上では,接続の成功~率は~port 443 の方が有意に高いことは記しておくべきだが、これは,時を経れば変わり得るものでもある。◎When a connection is to be made to a port that is shared by an HTTP server (a situation that is quite likely to occur with traffic to ports 80 and 443), the connection will appear to the HTTP server to be a regular GET request with an Upgrade offer.