aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/websocket/websocket/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/websocket/websocket/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/websocket/websocket/index.html')
-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>