Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server > SRO PServer Guides & Releases
You last visited: Today at 14:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE] node-sro-proxy - Opensource middleware/security layer

Discussion on [RELEASE] node-sro-proxy - Opensource middleware/security layer within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Closed Thread
 
Old 12/13/2020, 15:53   #16
 
elite*gold: 0
Join Date: Jun 2016
Posts: 6
Received Thanks: 0
Do you think add multiagent support? Awesome project
Legolas_ is offline  
Old 12/14/2020, 20:28   #17

 
Otakanikaru's Avatar
 
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 455
Quote:
Originally Posted by Legolas_ View Post
Do you think add multiagent support? Awesome project
i'll see what I can do about it - dont have myself an multi-agent server setup as I'm ok running my one on 1k slots only..

If anyone minds telling me which opcode controls this ill do it.
Otakanikaru is offline  
Old 12/14/2020, 20:56   #18
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 423
Received Thanks: 953
Quote:
Originally Posted by Artuuro_lv View Post
If anyone minds telling me which opcode controls this ill do it.
It's not an opcode. It's handled by the login queue linked to the QUEUE_ID sent from gameserver which specifies the agent:port to the client to connect.

That beind said, there is two options:
- Run a new agent server with the specified port (you'll change only the IP when you'll going to do the redirection).
- Save the QUEUE_ID link and create the proxy connection depending on what token it's sent to the agent server (dynamic proxy connection).
JellyBitz is offline  
Thanks
1 User
Old 12/14/2020, 23:17   #19

 
Otakanikaru's Avatar
 
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 455
Quote:
Originally Posted by JellyBitz View Post
It's not an opcode. It's handled by the login queue linked to the QUEUE_ID sent from gameserver which specifies the agentort to the client to connect.

That beind said, there is two options:
- Run a new agent server with the specified port (you'll change only the IP when you'll going to do the redirection).
- Save the QUEUE_ID link and create the proxy connection depending on what token it's sent to the agent server (dynamic proxy connection).
Cool - thanks, I'll add that in next commit.

Side note - I've just actually started test-driving production version on my project, so far seems to handle connections very well.
Users, be aware there's something wrong about setting players online/offline correctly in DB - it doesn't affect the proxy from working though - investigating this atm.
Otakanikaru is offline  
Old 01/18/2021, 13:57   #20

 
Otakanikaru's Avatar
 
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 455
[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_ View Post
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)
Otakanikaru is offline  
Thanks
2 Users
Old 01/20/2021, 17:27   #21

 
Otakanikaru's Avatar
 
elite*gold: 133
Join Date: Nov 2013
Posts: 454
Received Thanks: 455
[changelog]
- Updated thread information
- Added .sh launchers to the repo
- Fixed some minor bugs
- Download missing data folder from here: (required for IP geolocation and PROXY data access) - you can download your own copies from ip2location otherwise.
Otakanikaru is offline  
Closed Thread

Tags
fast, nodejs, proxy, safe, silkroad


Similar Threads Similar Threads
[WIP] node-sr-proxy (NodeJS silkroad proxy)
08/08/2022 - SRO Coding Corner - 10 Replies
NodeJS based packet interceptor & middle-ware layer for MMORPG Silkroad Online Game Client <---> Server. Public version repo: https://gitlab.com/sroparadise/node-sro_proxy Features - Packet whitelisting - Packet intercepting & manipulation - Multi module - Fully ECMAScript 9 - Basic middlewares:
[PHP] [NODE.JS][SOCKET.IO] Steve - Twitch BOT [NODE.JS][SOCKET.IO][PHP]
07/18/2015 - Web Development - 0 Replies
//Falsche Sektion? Dann bitte ich einen Moderatoren meinen Thread in die richtige Sektion zu verschieben. Danke! Steve Was genau ist Steve? Steve ist ein Aufpasser, ein visionär! Im endeffekt tut er das selbe wie die anderen Twitch Bot's. Er achtet auf jede Kleinigkeit und sorgt dafür, dass ruhe und frieden im Chat herrscht, damit jeder einen angenehmen Stream genießen kann. Welche Funktionen wird Steve beinhalten? Jeder Benutzer hat ein freundliches Benutzerinterface, wo er den Bot...
Layer Hilfe zu ! Layer Helps ! Layer Dosyasi Yardimi
03/08/2014 - Nostale - 5 Replies
Germany: Hallo Ich bin neu, um die Suche . Ich weiß nicht, Englisch und Deutsch mit Übersetzungen schrieb .NosTale Schicht-Server-Dateien auf dieser Seite sah ich s .Ich heruntergeladen und auf meinem Computer installiert , sp Er trägt Codes .Wie kann ich normalisieren ,Taste g pressure're tragen , moobs ,maps Namens alle zts , Ich lief von der Seite an die betreffenden Port , Turkish Local. exe konnte ich nicht finden Meine Anfrage von Ihnen 1-Turkish Local.exe 2-Turkish Port...



All times are GMT +1. The time now is 14:22.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.