• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Feature Embedded proxy in your server.

Mkalo

ボーカロイド
Senator
Joined
Jun 1, 2011
Messages
1,118
Solutions
55
Reaction score
944
Location
Japan
This was made in TFS 1.3 but should work in any TFS distribution as long you implement it correctly.

unknown[1].png

It works by changing the gameserver ip and port that the client is going to connect to. The proxyId is bound to the account and should be changed through your website. I won't provide any web page for this as there is too many AAC's so if you use it please consider sharing the page code with everyone (It would be nice since you are using this for free.)

You can add as many proxies you want in config.lua, tho it won't check if the proxy is alive or not.

Changes:
proxyList.patch · GitHub

And this in the database:
SQL:
ALTER TABLE `accounts` ADD `proxy_id` INT NOT NULL DEFAULT '0' AFTER `lastday`;

How to setup your proxy using nginx:

Run:
Code:
sudo nano /etc/nginx/nginx.conf

Add this:
Code:
stream {
    server {
        listen YOUR_PROXY_PORT;
        proxy_pass SERVER_IP:SERVER_PORT;
    }
}

Save it and run:
Code:
sudo nginx -s reload
 

Attachments

Last edited by a moderator:

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
7,027
Solutions
256
Reaction score
2,096
Location
Norway
GitHub
Znote
Nice, gonna be tricky to parse this config.lua file, but I will give it a go with Znote AAC.
Lua:
proxyList = {
    [1] = {ip = "158.69.12.213", port = 7172, name = "USA"},
    [2] = {ip = "2.2.2.2", port = 7177, name = "Germany"},
    [3] = {ip = "3.3.3.3", port = 7178, name = "Germany X2"}
}
 
OP
OP
Mkalo

Mkalo

ボーカロイド
Senator
Joined
Jun 1, 2011
Messages
1,118
Solutions
55
Reaction score
944
Location
Japan
Change the value in config to make easier for AAC's to parse the proxy list now the format is a string with:

Code:
"ID,IP,PORT,NAME;ID,IP,PORT,NAME..."

Each proxyInfo contains 4 values and they are separated by ";".
 

imkingran

Learning everyday.
Premium User
Joined
Jan 15, 2014
Messages
1,318
Solutions
35
Reaction score
434
Nice release @Mkalo

I was in the process of testing it but I ran into this problem on the nginx part:
Code:
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:87
 
OP
OP
Mkalo

Mkalo

ボーカロイド
Senator
Joined
Jun 1, 2011
Messages
1,118
Solutions
55
Reaction score
944
Location
Japan
Nice release @Mkalo

I was in the process of testing it but I ran into this problem on the nginx part:
Code:
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:87
Make sure you have nginx-full installed. The normal nginx doesnt comme with the stream directive enabled.
 

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,160
Solutions
2
Reaction score
112
How to install on apache and all we need is here on this thread? very thanks
 

Lais Prad

Disgusting Scammer
Joined
Apr 12, 2017
Messages
153
Solutions
6
Reaction score
15
This was made in TFS 1.3 but should work in any TFS distribution as long you implement it correctly.

View attachment 29645

It works by changing the gameserver ip and port that the client is going to connect to. The proxyId is bound to the account and should be changed through your website. I won't provide any web page for this as there is too many AAC's so if you use it please consider sharing the page code with everyone (It would be nice since you are using this for free.)

You can add as many proxies you want in config.lua, tho it won't check if the proxy is alive or not.

Changes:
proxyList.patch · GitHub

And this in the database:
SQL:
ALTER TABLE `accounts` ADD `proxy_id` INT NOT NULL DEFAULT '0' AFTER `lastday`;

How to setup your proxy using nginx:

Run:
Code:
sudo nano /etc/nginx/nginx.conf

Add this:
Code:
stream {
    server {
        listen YOUR_PROXY_PORT;
        proxy_pass SERVER_IP:SERVER_PORT;
    }
}

Save it and run:
Code:
sudo nginx -s reload

How to setup it on apache, I read some tutorials and I could not.

How To Use Apache HTTP Server As Reverse-Proxy Using mod_proxy Extension | DigitalOcean
Setting up a basic web proxy in apache
 

Lais Prad

Disgusting Scammer
Joined
Apr 12, 2017
Messages
153
Solutions
6
Reaction score
15
Nice release @Mkalo

I was in the process of testing it but I ran into this problem on the nginx part:
Code:
nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:87

Did you solved this? Same here and I was installed nginx-full
 

klenio0

New Member
Joined
May 10, 2010
Messages
85
Reaction score
1
What is the true function of this? would it be a tunel or just to mask the player's ip?
 

kor

PHP ziom
Premium User
Joined
Jul 12, 2008
Messages
226
Solutions
13
Reaction score
343
Location
Bialystok, Poland
GitHub
rookgaard
YouTube
Rookgaard
Hello @Mkalo

I have server in Europe, bought small VPS in US, installed there nginx, configured it to stream player packets to my gamesevrer port in EU with configuration you provided.

A.A.A.A - IP of EU server
B.B.B.B - IP of US proxy server
C.C.C.C - IP of Brazilian player
Code:
stream {
    server {
        listen 7172;
        proxy_pass A.A.A.A:7172;
    }
}

Here is example dump for one player from `tcptrack -r 5 -i eth0`
Code:
   Client             Server
C.C.C.C:49713     B.B.B.B:5061
B.B.B.B:56642     A.A.A.A:7172

And it works like a charm.

The problem is on EU server side all players have the same IP (B.B.B.B), so having a rule
Code:
iptables -A INPUT -p tcp --syn --dport 7172 -m connlimit --connlimit-above 3 -j REJECT
I will cut out every 3+ player using my US proxy.

I was trying to pass player headers to my EU server in nginx configuration, for example by
Code:
stream {
    server {
        listen 7172;
        proxy_pass_request_headers on;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Host $remote_addr;
        proxy_pass A.A.A.A:5061;
#        proxy_pass_request_headers on;
    }
}

But none of the lines (even one by one) don't cooperate with `stream`. How can I pass player's IP through stream to my server?
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,926
Solutions
10
Reaction score
335
Hello @MkaloBut none of the lines (even one by one) don't cooperate with `stream`. How can I pass player's IP through stream to my server?

Have your tried with:
Code:
proxy_bind $remote_addr transparent;
?
 

kor

PHP ziom
Premium User
Joined
Jul 12, 2008
Messages
226
Solutions
13
Reaction score
343
Location
Bialystok, Poland
GitHub
rookgaard
YouTube
Rookgaard
Not yet, but I did now. My nginx version is 1.10.3 and it don't support `transparent` parameter (it's supported from 1.11). I was trying to make an upgrade following this tutorial How to Install Nginx Latest Version on Ubuntu 16.04 and Ubuntu 16.10 but for now I'm unable because an error "nginx : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable". Sad, that latest nginx version at apt is only 1.10.3. I will try later to upgrade it and I will test again.

What version of nginx do you have? proxy_bind works for you with transparent parameter?
 

kor

PHP ziom
Premium User
Joined
Jul 12, 2008
Messages
226
Solutions
13
Reaction score
343
Location
Bialystok, Poland
GitHub
rookgaard
YouTube
Rookgaard
Not yet, but I did now. My nginx version is 1.10.3 and it don't support `transparent` parameter (it's supported from 1.11). I was trying to make an upgrade following this tutorial How to Install Nginx Latest Version on Ubuntu 16.04 and Ubuntu 16.10 but for now I'm unable because an error "nginx : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable". Sad, that latest nginx version at apt is only 1.10.3. I will try later to upgrade it and I will test again.

What version of nginx do you have? proxy_bind works for you with transparent parameter?

Edit: My distro is Debian GNU/Linux 9 (stretch)
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,926
Solutions
10
Reaction score
335
What version of nginx do you have? proxy_bind works for you with transparent parameter?

Sorry, I'm not using nginx proxy. Anyway, my server is also Debian and it's pretty old, thus nginx version available on it is 1.12.2.

I have following /etc/apt/sources.list:
Code:
# jessie-updates, previously known as 'volatile'
deb http://debian.mirrors.ovh.net/debian/ jessie-updates main
deb-src http://debian.mirrors.ovh.net/debian/ jessie-updates main

# jessie-backports, previously on backports.debian.org
deb http://debian.mirrors.ovh.net/debian/ jessie-backports main
deb-src http://debian.mirrors.ovh.net/debian/ jessie-backports main

deb http://debian.mirrors.ovh.net/debian/ jessie main contrib non-free
deb-src http://debian.mirrors.ovh.net/debian/ jessie main contrib non-free
deb [arch=amd64] https://download.docker.com/linux/debian jessie stable
 
Top