---
title: WebSocket.url
slug: Web/API/WebSocket/url
tags:
  - API
  - Property
  - Reference
  - Web API
  - WebSocket
browser-compat: api.WebSocket.url
---
{{APIRef("Web Sockets API")}}

The **`WebSocket.url`** read-only property returns the absolute
URL of the {{domxref("WebSocket")}} as resolved by the constructor.

## Syntax

```js
var url = aWebSocket.url;
```

## Value

A [`DOMString`](/en-US/docs/Web/API/DOMString "DOMString is a UTF-16 String. As JavaScript already uses such strings, DOMString is mapped directly to a String.").

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
