> For the complete documentation index, see [llms.txt](https://docs.1dex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1dex.com/developer/websocket-streams/overview.md).

# Overview

We use Socket.IO v4 protocol for WebSocket communication.

### Connection Information

* **WebSocket URL**:
  * for sandbox: `https://wss-test.1dex.com/socket.io`
  * for production: `https://wss.1dex.com/socket.io`
* **Protocol**: Socket.IO v4
* **Ping Interval**: 10 seconds
* **Ping Timeout**: 5 seconds
* **Connection Timeout**: 5 seconds

### Authentication Flow

#### 1. User Authentication

Users can authenticate by sending the `authenticate` event:

```javascript
socket.emit('authenticate', 'api-key');

socket.on('authenticated', (response) => {
    console.log(response);
    // response:
    // {
    //     "status": "success",
    //     "account": "account"
    // }
});
```

#### 2. Unauthenticate

```javascript
socket.emit('unauthenticate', 'api-key');
```
