WebSocketStream: thuộc tính url

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Note: This feature is available in Web Workers.

Thuộc tính chỉ đọc url của giao diện WebSocketStream trả về URL của máy chủ WebSocket mà thể hiện WebSocketStream được tạo với.

Giá trị

Một chuỗi.

Ví dụ

js
const wss = new WebSocketStream("wss://example.com/wss");

// Ghi "example.com/wss" ra console
console.log(wss.url);

Thông số kỹ thuật

Hiện chưa thuộc bất kỳ đặc tả nào. Xem https://github.com/whatwg/websockets/pull/48 để theo dõi tiến trình chuẩn hóa.

Tương thích trình duyệt

Xem thêm