Since so many idiots keep referencing the websocket code as something that steals your data and sends it to me; let me explain these "programmers" who keep posting it what it actually does.
What was the websocket for? keyword: was
The BetterDiscord websocket was used as a secondary websocket connection to Discord servers in order to catch messages etc.
BdWSocket.prototype.start = function () {
var self = this;
/* $.ajax({
method: "GET",
url: "https://discordapp.com/api/gateway",
headers: {
authorization: localStorage.token.match(/\"(.+)\"/)[1]
},
success: function (data) {
self.open(data.url);
}
});*/
};
as you can see the websocket connects to Discord servers just like the regular websocket. If you pay attention you'll see it's commented out after an agreement with Discord develepers to remove it.
Since it's commented out it's actually never even initialized. It is kept in the codebase purely for archival purposes.
But it gets my token from localstorage and then sends data somewhere???
The following code is usually referenced in these copypastes:
BdWSocket.prototype.onOpen = function () {
utils.log("Socket Open");
var data = {
op: 2,
d: {
token: JSON.parse(window.bdStorage.get('token')),
properties: JSON.parse(window.bdStorage.get('superProperties')),
v: 3
}
};
bdws.send(data);
};
What does this do? It used to send your token and props to Discord servers in order to authenticate the connection after it was opened.
I'll say this one more time: The socket hasn't even been used in a year or so and when it was it only connected to the Discord servers and nothing else.
I do not have any interest in your data, what you do on Discord or your user account. I respect your privacy and user security is important to me.
Wew