Decode a prepended VarInt from a byte stream of unknown size in javascript/Nodejs

I am writing a small utility library for me to request server status of a given minecraft host in js on node. I am using the Server List Ping Protocol as outlined here ( and got it mostly working as expected, albeit having big trouble working with unsupported Data Types (VarInt) and had to scour the internet to find a way of converting js nums into VarInts in order to craft the necessary packet buffers: Javascript nodejs, TCP socket

I am trying to send a TCP Request to a server via IP:PORT… This code works for me: var net = require('net'); var client = new net.Socket(); const port = 1337; const HOST = ""; function connect() { client.connect({ port: PORT, host: HOST }); client.on('data', (data) => { console.log(data); client.destroy(); }); client.on('close', function() { console.log('Connection … Read more

Proxying WebSockets with TCP load balancer without sticky sessions

I want to proxy WebSocket connections to multiple node.js servers using Amazon Elastic Load Balancer. Since Amazon ELB does not provide actual WebSocket support, I would need to use its vanilla TCP messaging. However, I’m trying to understand how this would work without some sort of sticky session functionality.