Skip to content

Instantly share code, notes, and snippets.

@hitthemoney
hitthemoney / Krunker WebSockets Explained.md
Last active May 1, 2024 08:03
This markdown file explains Krunker.io's social websockets and how to connect, get data from them, captchas, and more.

Krunker WebSockets Explained

WebSocket

WebSocket is a protocol over http. You should read: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API for more info on WebSocket.

Encoding/Decoding

Krunker uses msgpack for decoding and encoding packets. Msgpack is also smaller and sometimes faster depending on the implementation you use/make.

Packets

Like I said earlier, Krunker uses msgpack for decoding and encoding packets. A ping packet would like this: ["po"] which you send when you get a ["pi"] packet, and the ping result packet you receive is ["pir", ]. For fetching a profile, you can use ["r", "profile", , null]. The result packet would be like ["0", "profile", , , , , ...etc]. For finding packets, you can download https://krunker.io/social.html using a command like cURL, formatting the file and lo

Why python is a bad language

Weird Syntax

  • It is hard to read, because it is missing semicolons and braces.
  • Indentation as a syntactical element is just silly. This takes away freedom from the developer and makes the code less readable without any benefit.
  • Indentation-dependant scopes make multiple statements on one line look horrible.
  • Doc comments
    • They use triple quotes which doesn't make sense for a comment.
  • They go under what they are documenting, which looks wrong and is very unusual.