> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.closeSocket

> Close a WebSocket connection.

Close an active WebSocket connection.

## Parameters

| Property | Type     | Required | Description                   |
| -------- | -------- | -------- | ----------------------------- |
| success  | Function | No       | Callback on success           |
| fail     | Function | No       | Callback on failure           |
| complete | Function | No       | Callback that always executes |

## Code Example

```javascript theme={null}
my.onSocketOpen(() => {
  my.closeSocket();
});

my.onSocketClose((res) => {
  console.log('Socket closed');
});
```
