The horror begins
This commit is contained in:
parent
b4d5a2179e
commit
970c3c9d36
10 changed files with 804 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*/node_modules/*
|
233
mc/bufferstuff.lua
Normal file
233
mc/bufferstuff.lua
Normal file
|
@ -0,0 +1,233 @@
|
||||||
|
local util = require("util")
|
||||||
|
|
||||||
|
-- quick and dirty BIG ENDIAN ONLY port of bufferstuff to lua
|
||||||
|
|
||||||
|
local bufferStuff = {
|
||||||
|
Writer = {},
|
||||||
|
Reader = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- WRITER
|
||||||
|
|
||||||
|
local defaultsTableWriter = {
|
||||||
|
typeList = {">"},
|
||||||
|
dataValues = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bufferStuff.Writer:new()
|
||||||
|
local newTable = util.deepCopyTable(defaultsTableWriter) or {}
|
||||||
|
-- Set this table as this """class"""'s metatable
|
||||||
|
setmetatable(newTable, self)
|
||||||
|
self.__index = self
|
||||||
|
|
||||||
|
return newTable
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:toBuffer()
|
||||||
|
return string.pack(table.concat(self.typeList, ""), table.unpack(self.dataValues))
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeByte(value)
|
||||||
|
table.insert(self.typeList, "b")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeUByte(value)
|
||||||
|
table.insert(self.typeList, "B")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeBool(value)
|
||||||
|
table.insert(self.typeList, "B")
|
||||||
|
table.insert(self.dataValues, value and 1 or 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeShort(value)
|
||||||
|
table.insert(self.typeList, "h")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeUShort(value)
|
||||||
|
table.insert(self.typeList, "H")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeInt(value)
|
||||||
|
table.insert(self.typeList, "i")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeUInt(value)
|
||||||
|
table.insert(self.typeList, "I")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeLong(value)
|
||||||
|
table.insert(self.typeList, "l")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeULong(value)
|
||||||
|
table.insert(self.typeList, "L")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeFloat(value)
|
||||||
|
table.insert(self.typeList, "f")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeDouble(value)
|
||||||
|
table.insert(self.typeList, "d")
|
||||||
|
table.insert(self.dataValues, value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeShortString(value)
|
||||||
|
table.insert(self.typeList, "B")
|
||||||
|
table.insert(self.dataValues, #value)
|
||||||
|
|
||||||
|
for char in string.gmatch(value, ".") do
|
||||||
|
table.insert(self.typeList, "B")
|
||||||
|
table.insert(self.dataValues, string.byte(char))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeString(value)
|
||||||
|
table.insert(self.typeList, "H")
|
||||||
|
table.insert(self.dataValues, #value)
|
||||||
|
|
||||||
|
for char in string.gmatch(value, ".") do
|
||||||
|
table.insert(self.typeList, "B")
|
||||||
|
table.insert(self.dataValues, string.byte(char))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Writer:writeString16(value)
|
||||||
|
table.insert(self.typeList, "H")
|
||||||
|
table.insert(self.dataValues, #value)
|
||||||
|
|
||||||
|
for char in string.gmatch(value, ".") do
|
||||||
|
table.insert(self.typeList, "H")
|
||||||
|
table.insert(self.dataValues, string.byte(char))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- READER
|
||||||
|
|
||||||
|
local defaultsTableReader = {
|
||||||
|
bufferData = "",
|
||||||
|
offset = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function bufferStuff.Reader:new(data)
|
||||||
|
local newTable = util.deepCopyTable(defaultsTableReader) or {}
|
||||||
|
|
||||||
|
newTable.bufferData = data
|
||||||
|
|
||||||
|
-- Set this table as this """class"""'s metatable
|
||||||
|
setmetatable(newTable, self)
|
||||||
|
self.__index = self
|
||||||
|
|
||||||
|
return newTable
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readByte()
|
||||||
|
local value = string.unpack(">b", string.sub(self.bufferData, self.offset, self.offset + 1))
|
||||||
|
self.offset = self.offset + 1
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readUByte()
|
||||||
|
local value = string.unpack(">B", string.sub(self.bufferData, self.offset, self.offset + 1))
|
||||||
|
self.offset = self.offset + 1
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readShortString()
|
||||||
|
local length = string.unpack(">B", string.sub(self.bufferData, self.offset, self.offset + 1))
|
||||||
|
self.offset = self.offset + 1
|
||||||
|
local text = ""
|
||||||
|
|
||||||
|
for i = 1, length do
|
||||||
|
text = text .. string.char(string.unpack(">B", string.sub(self.bufferData, self.offset, self.offset + 1)))
|
||||||
|
self.offset = self.offset + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readShort()
|
||||||
|
local value = string.unpack(">h", string.sub(self.bufferData, self.offset, self.offset + 2))
|
||||||
|
self.offset = self.offset + 2
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readUShort()
|
||||||
|
local value = string.unpack(">h", string.sub(self.bufferData, self.offset, self.offset + 2))
|
||||||
|
self.offset = self.offset + 2
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readInt()
|
||||||
|
local value = string.unpack(">i", string.sub(self.bufferData, self.offset, self.offset + 4))
|
||||||
|
self.offset = self.offset + 4
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readUInt()
|
||||||
|
local value = string.unpack(">I", string.sub(self.bufferData, self.offset, self.offset + 4))
|
||||||
|
self.offset = self.offset + 4
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readLong()
|
||||||
|
local value = string.unpack(">l", string.sub(self.bufferData, self.offset, self.offset + 8))
|
||||||
|
self.offset = self.offset + 8
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readULong()
|
||||||
|
local value = string.unpack(">L", string.sub(self.bufferData, self.offset, self.offset + 8))
|
||||||
|
self.offset = self.offset + 8
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readFloat()
|
||||||
|
local value = string.unpack(">f", string.sub(self.bufferData, self.offset, self.offset + 4))
|
||||||
|
self.offset = self.offset + 4
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readDouble()
|
||||||
|
local value = string.unpack(">d", string.sub(self.bufferData, self.offset, self.offset + 8))
|
||||||
|
self.offset = self.offset + 8
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readString()
|
||||||
|
local length = string.unpack(">h", string.sub(self.bufferData, self.offset, self.offset + 2))
|
||||||
|
self.offset = self.offset + 2
|
||||||
|
local text = ""
|
||||||
|
|
||||||
|
for i = 1, length do
|
||||||
|
text = text .. string.char(string.unpack(">B", string.sub(self.bufferData, self.offset, self.offset + 1)))
|
||||||
|
self.offset = self.offset + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
|
||||||
|
function bufferStuff.Reader:readString16()
|
||||||
|
local length = string.unpack(">h", string.sub(self.bufferData, self.offset, self.offset + 2))
|
||||||
|
self.offset = self.offset + 2
|
||||||
|
local text = ""
|
||||||
|
|
||||||
|
for i = 1, length do
|
||||||
|
text = text .. string.char(string.unpack(">h", string.sub(self.bufferData, self.offset, self.offset + 2)))
|
||||||
|
self.offset = self.offset + 2
|
||||||
|
end
|
||||||
|
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
|
||||||
|
return bufferStuff
|
28
mc/chunk.lua
Normal file
28
mc/chunk.lua
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
local util = require("util")
|
||||||
|
local nibbleArray = require("nibbleArray")
|
||||||
|
|
||||||
|
local MAX_HEIGHT = 128
|
||||||
|
|
||||||
|
local chunk = {}
|
||||||
|
|
||||||
|
local defaultsTable = {
|
||||||
|
blocks = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function chunk:new()
|
||||||
|
local newTable = util.deepCopyTable(defaultsTable) or {}
|
||||||
|
|
||||||
|
local blockBufferSize = 16 * 16 * MAX_HEIGHT
|
||||||
|
for i = 1, blockBufferSize do
|
||||||
|
table.insert(newTable.blocks, 0)
|
||||||
|
end
|
||||||
|
print(#newTable.blocks)
|
||||||
|
|
||||||
|
-- Set this table as this """class"""'s metatable
|
||||||
|
setmetatable(newTable, self)
|
||||||
|
self.__index = self
|
||||||
|
|
||||||
|
return newTable
|
||||||
|
end
|
||||||
|
|
||||||
|
return chunk
|
50
mc/nibbleArray.lua
Normal file
50
mc/nibbleArray.lua
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
local util = require("util")
|
||||||
|
local bit32 = require("bit32")
|
||||||
|
|
||||||
|
local nibbleArray = {}
|
||||||
|
|
||||||
|
local defaultsTable = {
|
||||||
|
array = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function nibbleArray:new(sizeOrTable)
|
||||||
|
local newTable = util.deepCopyTable(defaultsTable) or {}
|
||||||
|
|
||||||
|
if type(sizeOrTable) == "number" then
|
||||||
|
for i = 1, sizeOrTable do
|
||||||
|
table.insert(newTable.array, 0)
|
||||||
|
end
|
||||||
|
elseif type(sizeOrTable) == "table" then
|
||||||
|
self.array = sizeOrTable
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set this table as this """class"""'s metatable
|
||||||
|
setmetatable(newTable, self)
|
||||||
|
self.__index = self
|
||||||
|
|
||||||
|
return newTable
|
||||||
|
end
|
||||||
|
|
||||||
|
function nibbleArray:get(index)
|
||||||
|
local arrayIndex = math.floor(index * 0.5)
|
||||||
|
if bit32.band(index, 1) == 0 then
|
||||||
|
return bit32.band(self.array[arrayIndex + 1], 0xf)
|
||||||
|
else
|
||||||
|
return bit32.band(bit32.rshift(self.array[arrayIndex + 1], 4), 0xf)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function nibbleArray:set(index, value)
|
||||||
|
local arrayIndex = math.floor(index * 0.5)
|
||||||
|
if bit32.band(index, 1) == 0 then
|
||||||
|
self.array[arrayIndex + 1] = bit32.bor(bit32.band(self.array[arrayIndex + 1], 0xf0), bit32.band(value, 0xf))
|
||||||
|
else
|
||||||
|
self.array[arrayIndex + 1] = bit32.bor(bit32.band(self.array[arrayIndex + 1], 0xf), bit32.rshift(bit32.band(value, 0xf), -4))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function nibbleArray:toBuffer()
|
||||||
|
return self.array
|
||||||
|
end
|
||||||
|
|
||||||
|
return nibbleArray
|
53
mc/packet.lua
Normal file
53
mc/packet.lua
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
local packet = {
|
||||||
|
KeepAlive = 0x00,
|
||||||
|
LoginRequest = 0x01,
|
||||||
|
Handshake = 0x02,
|
||||||
|
Chat = 0x03,
|
||||||
|
TimeUpdate = 0x04,
|
||||||
|
EntityEquipment = 0x05,
|
||||||
|
SpawnPosition = 0x06,
|
||||||
|
UseEntity = 0x07,
|
||||||
|
UpdateHealth = 0x08,
|
||||||
|
Respawn = 0x09,
|
||||||
|
Player = 0x0A,
|
||||||
|
PlayerPosition = 0x0B,
|
||||||
|
PlayerLook = 0x0C,
|
||||||
|
PlayerPositionLook = 0x0D,
|
||||||
|
PlayerDigging = 0x0E,
|
||||||
|
PlayerBlockPlacement = 0x0F,
|
||||||
|
HoldingChange = 0x10,
|
||||||
|
UseBed = 0x11,
|
||||||
|
Animation = 0x12,
|
||||||
|
EntityAction = 0x13,
|
||||||
|
NamedEntitySpawn = 0x14,
|
||||||
|
PickupSpawn = 0x15,
|
||||||
|
CollectItem = 0x16,
|
||||||
|
|
||||||
|
EntityVelocity = 0x1C,
|
||||||
|
DestroyEntity = 0x1D,
|
||||||
|
|
||||||
|
EntityStatus = 0x26,
|
||||||
|
EntityMetadata = 0x28,
|
||||||
|
|
||||||
|
PreChunk = 0x32,
|
||||||
|
MapChunk = 0x33,
|
||||||
|
MultiBlockChange = 0x34,
|
||||||
|
BlockChange = 0x035,
|
||||||
|
|
||||||
|
SoundEffect = 0x3D,
|
||||||
|
|
||||||
|
Entity = 0x1E,
|
||||||
|
EntityRelativeMove = 0x1F,
|
||||||
|
EntityLook = 0x20,
|
||||||
|
EntityLookRelativeMove = 0x21,
|
||||||
|
EntityTeleport = 0x22,
|
||||||
|
|
||||||
|
CloseWindow = 0x65,
|
||||||
|
WindowClick = 0x66,
|
||||||
|
SetSlot = 0x67,
|
||||||
|
WindowItems = 0x68,
|
||||||
|
|
||||||
|
DisconnectKick = 0xff
|
||||||
|
}
|
||||||
|
|
||||||
|
return packet
|
65
mc/server.lua
Normal file
65
mc/server.lua
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
-- local bufferStuff = require("bufferstuff")
|
||||||
|
-- local writer = bufferStuff.Writer:new()
|
||||||
|
-- writer:writeUByte(10)
|
||||||
|
-- writer:writeUByte(67)
|
||||||
|
-- writer:writeString16("Hello World!")
|
||||||
|
|
||||||
|
-- local reader = bufferStuff.Reader:new(writer:toBuffer())
|
||||||
|
-- print(reader:readUByte())
|
||||||
|
-- print(reader:readUByte())
|
||||||
|
-- print(reader:readString16())
|
||||||
|
|
||||||
|
local chunk = require("chunk")
|
||||||
|
local packet = require("packet")
|
||||||
|
local bufferStuff = require("bufferstuff")
|
||||||
|
|
||||||
|
local tempChunk = chunk:new()
|
||||||
|
|
||||||
|
local function doWebsocket()
|
||||||
|
local ws = http.websocket("ws://localhost:25567")
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local b, bv, data, bx = os.pullEvent("websocket_message")
|
||||||
|
|
||||||
|
local reader = bufferStuff.Reader:new(data)
|
||||||
|
local packetId = reader:readByte()
|
||||||
|
if packetId == packet.LoginRequest then
|
||||||
|
local protocolVersion = reader:readInt()
|
||||||
|
local username = reader:readString16()
|
||||||
|
local mapSeed = reader:readLong()
|
||||||
|
local dimension = reader:readByte()
|
||||||
|
print(username .. " is requesting login")
|
||||||
|
|
||||||
|
local writer = bufferStuff.Writer:new()
|
||||||
|
writer:writeByte(packet.LoginRequest) -- Packet ID
|
||||||
|
writer:writeInt(1) -- Entity ID
|
||||||
|
writer:writeString16("") -- Login Token
|
||||||
|
writer:writeLong(0) -- Seed
|
||||||
|
writer.writeByte(0) -- Dimension
|
||||||
|
ws.send(writer:toBuffer())
|
||||||
|
print("Login granted")
|
||||||
|
|
||||||
|
elseif packetId == packet.Handshake then
|
||||||
|
local username = reader:readString16()
|
||||||
|
print(username .. " is probing the server")
|
||||||
|
|
||||||
|
local writer = bufferStuff.Writer:new()
|
||||||
|
writer:writeByte(packet.Handshake)
|
||||||
|
writer:writeString16("-")
|
||||||
|
ws.send(writer:toBuffer())
|
||||||
|
print("Handshake ACK sent")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local tickCount = 0
|
||||||
|
local function serverTickLoop()
|
||||||
|
while true do
|
||||||
|
|
||||||
|
|
||||||
|
os.sleep(0.05)
|
||||||
|
tickCount = tickCount + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
parallel.waitForAll(doWebsocket, serverTickLoop)
|
18
mc/util.lua
Normal file
18
mc/util.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
local util = {}
|
||||||
|
|
||||||
|
function util.deepCopyTable(originalTable)
|
||||||
|
if originalTable == nil then return nil end
|
||||||
|
|
||||||
|
local tableCopy = {}
|
||||||
|
for key, value in pairs(originalTable) do
|
||||||
|
if type(value) == "table" then
|
||||||
|
tableCopy[key] = util.deepCopyTable(value)
|
||||||
|
else
|
||||||
|
tableCopy[key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return tableCopy
|
||||||
|
end
|
||||||
|
|
||||||
|
return util
|
56
theforwarder/index.ts
Normal file
56
theforwarder/index.ts
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
import { WebSocket, WebSocketServer } from "ws";
|
||||||
|
import { createServer, Socket } from "net";
|
||||||
|
import { createWriter, Endian } from "bufferstuff";
|
||||||
|
|
||||||
|
const server = new WebSocketServer({
|
||||||
|
host: "0.0.0.0",
|
||||||
|
port: 25567
|
||||||
|
});
|
||||||
|
|
||||||
|
server.on("listening", () => console.log("up"));
|
||||||
|
|
||||||
|
let serverSocket:WebSocket|null = null;
|
||||||
|
function writeServer(data:Buffer) {
|
||||||
|
if (serverSocket) {
|
||||||
|
serverSocket.send(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let clientSocket:Socket|null = null;
|
||||||
|
function writeClient(data:Buffer) {
|
||||||
|
if (clientSocket) {
|
||||||
|
clientSocket.write(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const keepalivePacket = createWriter(Endian.BE, 1).writeByte(0).toBuffer();
|
||||||
|
|
||||||
|
server.on("connection", (socket) => {
|
||||||
|
serverSocket = socket;
|
||||||
|
console.log("Server is ready");
|
||||||
|
|
||||||
|
let interval = setInterval(() => {
|
||||||
|
socket.send(keepalivePacket);
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
socket.on("message", (data, isBinary) => {
|
||||||
|
writeClient(data as Buffer);
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("error", () => {
|
||||||
|
clearInterval(interval);
|
||||||
|
});
|
||||||
|
socket.on("close", () => {
|
||||||
|
clearInterval(interval);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const clientServer = createServer((socket) => {
|
||||||
|
clientSocket = socket;
|
||||||
|
console.log("Client is ready");
|
||||||
|
|
||||||
|
socket.on("data", data => {
|
||||||
|
writeServer(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
clientServer.listen(25565, () => console.log("Client server listening at 25565"));
|
278
theforwarder/package-lock.json
generated
Normal file
278
theforwarder/package-lock.json
generated
Normal file
|
@ -0,0 +1,278 @@
|
||||||
|
{
|
||||||
|
"name": "theforwarder",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "theforwarder",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"bufferstuff": "^1.5.1",
|
||||||
|
"ws": "^8.18.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.14.10",
|
||||||
|
"@types/ws": "^8.5.10",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.5.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@cspotcode/source-map-support": {
|
||||||
|
"version": "0.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
||||||
|
"integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/trace-mapping": "0.3.9"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@jridgewell/resolve-uri": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@jridgewell/sourcemap-codec": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
||||||
|
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@jridgewell/trace-mapping": {
|
||||||
|
"version": "0.3.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
|
||||||
|
"integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/resolve-uri": "^3.0.3",
|
||||||
|
"@jridgewell/sourcemap-codec": "^1.4.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tsconfig/node10": {
|
||||||
|
"version": "1.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz",
|
||||||
|
"integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@tsconfig/node12": {
|
||||||
|
"version": "1.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
|
||||||
|
"integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@tsconfig/node14": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@tsconfig/node16": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "20.14.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz",
|
||||||
|
"integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~5.26.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/ws": {
|
||||||
|
"version": "8.5.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz",
|
||||||
|
"integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/acorn": {
|
||||||
|
"version": "8.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
||||||
|
"integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"acorn": "bin/acorn"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/acorn-walk": {
|
||||||
|
"version": "8.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz",
|
||||||
|
"integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"acorn": "^8.11.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/arg": {
|
||||||
|
"version": "4.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||||
|
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/bufferstuff": {
|
||||||
|
"version": "1.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/bufferstuff/-/bufferstuff-1.5.1.tgz",
|
||||||
|
"integrity": "sha512-IQF03UD+569MX80y70eOrFBhAhavEIOL12WJlVCKDSjOhCVueEY/MjwJPhW4Z1mbd9HcqEeZChldRwbqJP8k1w==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/create-require": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/diff": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/make-error": {
|
||||||
|
"version": "1.3.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
|
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/ts-node": {
|
||||||
|
"version": "10.9.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
|
||||||
|
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@cspotcode/source-map-support": "^0.8.0",
|
||||||
|
"@tsconfig/node10": "^1.0.7",
|
||||||
|
"@tsconfig/node12": "^1.0.7",
|
||||||
|
"@tsconfig/node14": "^1.0.0",
|
||||||
|
"@tsconfig/node16": "^1.0.2",
|
||||||
|
"acorn": "^8.4.1",
|
||||||
|
"acorn-walk": "^8.1.1",
|
||||||
|
"arg": "^4.1.0",
|
||||||
|
"create-require": "^1.1.0",
|
||||||
|
"diff": "^4.0.1",
|
||||||
|
"make-error": "^1.1.1",
|
||||||
|
"v8-compile-cache-lib": "^3.0.1",
|
||||||
|
"yn": "3.1.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"ts-node": "dist/bin.js",
|
||||||
|
"ts-node-cwd": "dist/bin-cwd.js",
|
||||||
|
"ts-node-esm": "dist/bin-esm.js",
|
||||||
|
"ts-node-script": "dist/bin-script.js",
|
||||||
|
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||||
|
"ts-script": "dist/bin-script-deprecated.js"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@swc/core": ">=1.2.50",
|
||||||
|
"@swc/wasm": ">=1.2.50",
|
||||||
|
"@types/node": "*",
|
||||||
|
"typescript": ">=2.7"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@swc/core": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"@swc/wasm": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "5.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
|
||||||
|
"integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "5.26.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/v8-compile-cache-lib": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/ws": {
|
||||||
|
"version": "8.18.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
|
||||||
|
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": ">=5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/yn": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
theforwarder/package.json
Normal file
22
theforwarder/package.json
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "theforwarder",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"dev:run": "nodemon --watch './**/*.ts' index.ts"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": "",
|
||||||
|
"dependencies": {
|
||||||
|
"bufferstuff": "^1.5.1",
|
||||||
|
"ws": "^8.18.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.14.10",
|
||||||
|
"@types/ws": "^8.5.10",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.5.3"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue