Try to fix things again.

This commit is contained in:
bʰedoh₂ swé 2024-12-18 22:28:53 +05:00
parent 3745fd9218
commit 450b22ccf7

View File

@ -44,8 +44,10 @@ let srv = net.createServer(function(socket: net.Socket) {
if (addr == "127.0.0.1") {
let p = pp.V1ProxyProtocol.parse(String(data));
addr = p.source.ipAddress;
if (typeof p.data === 'string') {
data = p.data;
if (typeof p.data === 'undefined') {
return;
} else {
data = data.slice(p.data.length);
}
} else {
console.log("Address " + addr + " tried to use proxy protocol.");