Back

Discord's Telemetry on WebSocket Connect

Small write-up about Discord's telemetry on it's WebSocket connection.

Intro

Discord uses a WebSocket for communication between their servers and it’s web client. I decided to look into it to see if it has any telemetry with their desktop client (even a tiny amount); it does.

The WebSocket

WebSocket Intro

WebSockets are great for using low bandwidth / data and fast communication, as it is event-driven and can easily support compressed and small messages. They are primarily used in the web, but can also be used server-side for some things.

Gateway

Discord call their WebSocket their “gateway”, hosted on gateway.discord.gg. It is used primarily for actions which require speed so it would be ineffective to use their HTTP REST API. Primarily, it looks like it is used to recieving messages. It is connected with some query parameters, for example:

wss://gateway.discord.gg/?encoding=etf&v=8&compress=zlib-stream

The Telemetry

Overview

On connection of the WebSocket in Discord’s desktop app, it sends a collection of information about the user’s OS setup. Below is an example of the telemetry on my current setup.

Hex View

A view of the message in a Hex Editor

(That hex editor is ImHex by WerWolv by the way)

Simplified View

properties:
os Linux
browser Discord Client
release_channel canary
client_version 00115
os_version 599-zen1-1-zen
os_arch x64
window_manager i3,i3
distro "Arch Linux"

presence:
status online

activities:
afks false
compress false

Adapted from a Twitter thread