Uses Cloudflare Worker's TCP API to get the server-list player count, message-of-the-day, and player sample. This is the same data you'd see on the multiplayer server list.
This light-weight approach parrots the same packets sent by the Notchian client:
- Server-bound handshake
- Server-bound status request
- Client-bound status response
Using what wiki.vg publishes we can use Buffer
, from the standard library, and leb
, a third-party package for working with base 128 little endian bytes.
Wireshark then let's us verify and debug our work:
notchian client 10 00 f9 05 09 6c 6f 63 61 6c 68 6f 73 74 63 dd 01
worker client 10 00 fa 05 09 6c 6f 63 61 6c 68 6f 73 74 63 dd 01
For example, this helped me realize a mismatch between using little and big endian byte order for the server port in the handshake packet!