コンテンツにスキップ

WebSocket

出典: フリー百科事典『ウィキペディア(Wikipedia)』

WebSocketTCP1WebSocket2011RFC 6455IETFWeb IDLWebSocket APIW3CWHATWG

WebSocketHTTPOSI74TCPRFC 6455WebSocketHTTPHTTP44380HTTPWebSocketHTTP/1.1 Upgrade使HTTPWebSocket


概要

[編集]

XMLHttpRequestComet

AjaxXMLHttpRequestCometTCPHTTPXMLHttpRequest#

WebSocketHTTP使[1]

プロトコル

[編集]

WebSocketHTTP/1.1


GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13


HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat

HTTPHTTPWebSocket

URIスキーム

[編集]

WebSocketプロトコルの仕様書はws:wss:という2つの新しいURIスキームを定義している[2]

実装状況

[編集]

クライアント

[編集]

Internet Explorer 10Mozilla Firefox 6 (Firefox for Mobile7)Google Chrome 4 ()Safari5iOS 4.2Opera 12.10Android 4.4BlackBerry7
実装状況
プロトコル Internet Explorer Mozilla Firefox Google Chrome Safari Opera Android
draft-hixie-thewebsocketprotocol-75 4 5.0.0
draft-hixie-thewebsocketprotocol-76
draft-ietf-hybi-thewebsocketprotocol-00
4(無効化) 6 5.0.1 11.00(要設定)
Opera Mobileも要設定
draft-ietf-hybi-thewebsocketprotocol-07 6
draft-ietf-hybi-thewebsocketprotocol-10 7 14
RFC 6455 10 11 16 6 12.10 4.4

ウェブブラウザのプラグインを利用する物

プロトコル上のSec-WebSocket-Version:とドラフト番号の対応関係は以下の通り。hybi-04からプロトコル上に対応するドラフト番号が現れるようになった。

Sec-WebSocket-Version: ドラフト番号
4 hybi-04
5 hybi-05
6 hybi-06
7 hybi-07
8 hybi-08〜12
13 hybi-13〜17
RFC 6455

サーバ

[編集]

歴史的経緯

[編集]

20115[5]2011711draft-ietf-hybi-thewebsocketprotocol-10[6]2011930 draft-ietf-hybi-thewebsocketprotocol-1720111211RFC 6455proposed standard

20101126draft-ietf-hybi-thewebsocketprotocol-03WebSocket[7]201012Firefox 4Opera 11WebSocketChromeOpera 11opera:config#Enable%20WebSockets2011111draft-ietf-hybi-thewebsocketprotocol-04XOR2011816WebSocketFirefox 6 Firefox 10MozWebSocketMoz[8]Firefox for Mobile7[9]

JavaScriptAPIW3CHTML5WHATWG

WHATWGHTML StandardWebSocketAPI2021[10]WebSockets Standard

関連項目

[編集]

参照

[編集]

外部リンク

[編集]