> For the complete documentation index, see [llms.txt](/llms.txt).

- Snap

# snap_getWebSockets

Get the connected WebSockets for the Snap.

## Parameters[​](#parameters "Direct link to Parameters")

This method does not have any parameters.

## Returns[​](#returns "Direct link to Returns")

object[]

An array of connected WebSockets for the Snap.

object

### id

string

The unique identifier of the WebSocket connection.

### url

string

The URL of the WebSocket connection.

### protocols

string[]

An array of subprotocols used in the WebSocket connection (if any).

## Example

- Manifest
- Usage

```
{
  "initialPermissions": {
    "endowment:network-access": {}
  }
}

```

```
const webSockets = await snap.request({ method: 'snap_getWebSockets' })
console.log(webSockets)
// Example output:
// [
//   {
//     id: 'websocket-1',
//     url: 'wss://example.com/socket',
//     protocols: ['protocol1', 'protocol2'],
//   },
//   {
//     id: 'websocket-2',
//     url: 'ws://example.org/endpoint',
//     protocols: [],
//   },
// ]

```
