MDN self-hosted library · e01.org

WebSocketStream: url property

WebSockets API

Open notebook · 1 cells web-api-instance-property upstream source

WebSockets API

The url read-only property of the WebSocketStream interface returns the URL of the WebSocket server that the WebSocketStream instance was created with.

Value

A string.

Examples

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

// Logs "example.com/wss" to the console
console.log(wss.url);

Specifications

Not currently a part of any specification. See https://github.com/whatwg/websockets/pull/48 for standardization progress.

Browser compatibility

See also