[Changelog]
- Each module can now be configured over process.env (see ".bat" files)
- Better online/offline handling
- Fixed HWID limitation
Side note:
I have now been running this on my own project (production) for about a month - connections are very smooth and low latency, increasing players count doesn't affect proxy's performance, HWID / IP blacklisting works, HWID limits works (one thing to mention is that you might need to set all users connected = 0 when you restart the proxy - depends how you switched it off).
Another side note:
I'm considering creating custom features (as a service) on demand and might as well provide this as a SaaS (hosted solution) - anyone interested please contact me on my discord "Artuuro#6727".
Quote:
Originally Posted by Legolas_
Do you think add multiagent support? Awesome project 
|
Figured out it is quite simple
You can use this version of "src/controllers/LoginResponse.js" for multi-agent support, pay attention to comments i've left.
Code:
async function LoginResponse({ config, stream, memory, api }, packet) {
const { AgentServer } = config.REDIRECT;
const { writer, reader } = stream;
const read = new reader(packet.data);
const status = read.uint8();
const { get, put } = api.proxy;
const username = memory.get('username');
if (status == 1) {
const {
data,
} = await get(`/instances`, {
filter: JSON.stringify({ username }),
limit: 1
});
const [instance] = data;
if (instance) {
await put(`/instances/${instance.id}`, {
connected: 1
});
const token = read.uint32();
const host = read.string();
// E.g. from->to IP 127.0.0.1 -> redirects to 192.168.0.1
const redirects = {
'127.0.0.1': '192.168.0.1',
'127.0.0.2': '192.168.0.2',
};
//add as many agents u want
const write = new writer();
write.uint8(status);
write.uint32(token);
write.string(redirects[host]); // select the redirection rule
write.uint16(AgentServer.PORT);
return {
packet: {
...packet,
data: write.toData(),
}
};
}
}
return { exit: true };
}
export default LoginResponse;
JS Saves the day.
UPDATE
- Added simple bot detection (requires client locale 51)
- NoticeRequest packet rewrite
- Login packet fix
- IP:PORT redirection rule system (allows multiple agents, downloadservers)