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)