Skip to content

Instantly share code, notes, and snippets.

@Jiiks
Created April 12, 2017 01:54
Show Gist options
  • Save Jiiks/7776ce38756fda644528224efd6d7afd to your computer and use it in GitHub Desktop.
Save Jiiks/7776ce38756fda644528224efd6d7afd to your computer and use it in GitHub Desktop.
BetterDiscord Websocket explanation

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.

@tilda
Copy link

tilda commented Apr 12, 2017

👍

@MayhemBill
Copy link

Good to have a source to show people you don't steal the info, tired of people just believing anything they hear, and not getting the full info.

@xSynthx
Copy link

xSynthx commented Apr 12, 2017

k, that was a stupid ping, but k and im also tired of that "BD steals your stuff" shit. -.-

@Zekken01
Copy link

I'm just commenting here because I can.

@0mniscient
Copy link

I'd smash

@Vap0r1ze
Copy link

oh noes not my super properties :OOOO

Copy link

ghost commented Apr 12, 2017

@everyone ping, wew

@notmike101
Copy link

But tokens taste good

@RawrXDish
Copy link

lul

@injectJon
Copy link

👍

@NexxusDrako313
Copy link

Now I have a link to share when this "BD steals your stuff" crap pops up again. Thanks Jiiks.

@BeardDesign1
Copy link

k.

@Ckath
Copy link

Ckath commented Apr 12, 2017

Solving confusion caused by people not reading with a written explanation,
I can only imagine this'll end great

@YaBoyWonder
Copy link

welp thats interesting to see

@gavwin
Copy link

gavwin commented Apr 25, 2017

Wew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment