From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/websocket/protocol/index.html | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 files/zh-cn/web/api/websocket/protocol/index.html (limited to 'files/zh-cn/web/api/websocket/protocol') diff --git a/files/zh-cn/web/api/websocket/protocol/index.html b/files/zh-cn/web/api/websocket/protocol/index.html new file mode 100644 index 0000000000..8a575f1180 --- /dev/null +++ b/files/zh-cn/web/api/websocket/protocol/index.html @@ -0,0 +1,41 @@ +--- +title: WebSocket.protocol +slug: Web/API/WebSocket/protocol +translation_of: Web/API/WebSocket/protocol +--- +

{{APIRef("Web Sockets API")}}

+ +

WebSocket.protocol 是个只读属性,用于返回服务器端选中的子协议的名字;这是一个在创建{{domxref("WebSocket")}} 对象时,在参数{{domxref("protocols")}}中指定的字符串,当没有已建立的链接时为空串。

+ +

语法

+ +
var protocol = aWebSocket.protocol;
+ +

返回值

+ +

DOMString.

+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#dom-websocket-protocol', 'WebSocket: protocol')}}{{Spec2('HTML WHATWG')}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("api.WebSocket.protocol")}}

-- cgit v1.2.3-54-g00ecf