- Port-transfering for Minecraft
- Fallback ping server
... and there will be more (dummy minecraft server...) !
[ Minecraft client ]
↕
[ SakuraMC proxy ]
↑
│ ↓ Request to open a new socket for the Minecraft client
│
│ ↑ Open a new socket
↓
[ SakuraMC client ]
↕
[ Minecraft server ]
[ Minecraft client ]
↑
│ ↓ Ping request
│
│ ↑ Return error message and block login
↓
[ SakuraMC proxy ]
$ node dist/index.js proxy 12343 25565
$ node dist/index.js client minecraft-server:25565 sakuramc-proxy:12343
const controlPort = 12343; // Use this port to receive SakuraMC control packet
const receptionPort = 25565; // Use this port to receive Minecraft packet
new Proxy(controlPort, receptionPort);
const client = new Client({ host: "sakuramc-proxy", port: 12343 }, { host: "minecraft-server", port: 25565 });
client.on("error", err => {
console.error(err);
process.exit(1);
});
pnpm run pack
... And run dist/SakuraMC-Client.exe!