WebSocket.protocol
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebSocket.protocol
是个只读属性,用于返回服务器端选中的子协议的名字;这是一个在创建 WebSocket
对象时,在参数 protocols
中指定的字符串,当没有已建立的链接时为空串。
语法
var protocol = aWebSocket.protocol;
返回值
规范
Specification |
---|
WebSockets # ref-for-dom-websocket-protocol① |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
protocol |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.