WebSocketStream: url 属性
注意:此功能在 Web Workers 中可用。
WebSocketStream
接口的只读属性 url
返回创建 WebSocketStream
实例时使用的 WebSocket 服务器的 URL。
值
字符串。
示例
js
const wss = new WebSocketStream("wss://example.com/wss");
// Logs "example.com/wss" to the console
console.log(wss.url);
规范
目前不是任何规范的一部分。有关标准化进展,请参阅 https://github.com/whatwg/websockets/pull/48。
浏览器兼容性
加载中…
另见
- WebSocketStream:将流与 WebSocket API 集成,developer.chrome.com (2020)