add ps2.nice.kiwi as source

This commit is contained in:
41666 2022-12-22 15:47:55 -05:00
parent b9e2a1879e
commit 2a843d2274
12 changed files with 612 additions and 7 deletions

22
hack/kiwitest/raw.js Normal file
View file

@ -0,0 +1,22 @@
const WebSocket = require("ws");
const wsc = new WebSocket(
"wss://planetside-2-api.herokuapp.com/socket.io/?EIO=3&transport=websocket",
{
origin: "https://ps2.nice.kiwi",
}
);
wsc.on("open", () => {
wsc.send(`42["worlds-update-request"]`);
});
wsc.on("message", (e) => {
const messageRaw = e.toString();
if (messageRaw.startsWith("42")) {
const [event, message] = JSON.parse(messageRaw.slice(2));
console.log({ message });
wsc.close();
}
});