Fixed "one client per IP" thing
This commit is contained in:
parent
ca051c6821
commit
c43e1b0fb2
|
|
@ -77,19 +77,6 @@ sock.on('message', (msg, info) => {
|
|||
sock.send(enc, info.port, info.address);
|
||||
return;
|
||||
}
|
||||
if (dec.length == 4 &&
|
||||
dec[0] == 0x55 && dec[1] == 0x44 && dec[2] == 0xe9 && dec[3] == 0x37) {
|
||||
const buff = Buffer.from([
|
||||
0xe7,
|
||||
0x5a,
|
||||
0x3d,
|
||||
0xea
|
||||
]);
|
||||
const enc = encrypt(buff, acc.key, config.iv, config.algorithm);
|
||||
sock.send(enc, info.port, info.address);
|
||||
delete conns[info.address];
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dec[0] >> 4) !== 4) return;
|
||||
const packet = IP.decode(dec);
|
||||
|
|
@ -103,7 +90,6 @@ sock.on('message', (msg, info) => {
|
|||
if (!user) return;
|
||||
const targetIp = ips[user.username];
|
||||
const targetPort = ports[user.username];
|
||||
console.log(targetIp, targetPort, user, ips, ports);
|
||||
if (!targetIp || !targetPort) return;
|
||||
sock.send(encrypt(dec, user.key, config.iv, config.algorithm), targetPort, targetIp);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue