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.
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.
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:
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.
(That hex editor is ImHex by WerWolv by the way)
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