aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/websocket/websocket
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/api/websocket/websocket')
-rw-r--r--files/ja/web/api/websocket/websocket/index.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/files/ja/web/api/websocket/websocket/index.html b/files/ja/web/api/websocket/websocket/index.html
new file mode 100644
index 0000000000..77289d22ba
--- /dev/null
+++ b/files/ja/web/api/websocket/websocket/index.html
@@ -0,0 +1,56 @@
+---
+title: WebSocket()
+slug: Web/API/WebSocket/WebSocket
+translation_of: Web/API/WebSocket/WebSocket
+---
+<p>{{APIRef("Web Sockets API")}}</p>
+
+<p><code><strong>WebSocket()</strong></code><strong> </strong>コンストラクタは新しい{{domxref("WebSocket")}} オブジェクトを返します。</p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="notranslate">var <em>aWebSocket</em> = new WebSocket(<em>url</em> [, protocols]);</pre>
+
+<h3 id="引数">引数</h3>
+
+<dl>
+ <dt><code>url</code></dt>
+ <dd>接続先のURL。WebSocketサーバが応答するURLでなければならない。</dd>
+ <dt><code>protocols</code> {{optional_inline}}</dt>
+ <dd>プロトコル文字列ひとつもしくはその配列。サーバは複数のWebSocketサブプロトコルを実装することもでき、その文字列はサブプロトコルを指定するために使われる(例えば、一つのサーバが指定された<code>protocol</code>に応じて異なるタイプのやりとりを扱うようにしたい場合)。プロトコル文字列を指定しない場合は空文字列と見なされる。</dd>
+</dl>
+
+<h3 id="投げられる例外">投げられる例外</h3>
+
+<dl>
+ <dt><code>SECURITY_ERR</code></dt>
+ <dd>接続が試みられているポートがブロックされている場合</dd>
+</dl>
+
+<dl>
+ <dt><a href="/ja/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError">SyntaxError</a></dt>
+ <dd>URLが無効だった場合</dd>
+</dl>
+
+<h2 id="仕様書">仕様書</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状況</th>
+ <th scope="col">コメント</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', '#dom-websocket', 'the WebSocket constructor')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="ブラウザ互換性">ブラウザ互換性</h2>
+
+
+
+<p>{{Compat("api.WebSocket.WebSocket")}}</p>