FastDL: Difference between revisions
(Created page with "= What is FastDL? = FastDL is a technology which can receive files from another server. The major advantage of doing this is balancing the network. = FastDL in 0.3.7 = Unlike...") |
mNo edit summary |
||
| Line 72: | Line 72: | ||
''Tip: You can check these files if you go to the link in your browser (if your "autoload" was enabled)'' | ''Tip: You can check these files if you go to the link in your browser (if your "autoload" was enabled)'' | ||
== RAGE Server == | |||
Finally, the last step is to edit the rage config. As you can read in the [https://wiki.rage.mp/index.php?title=Server_settings documentation], you need to insert the option “fastdl-host” in your config file. | Finally, the last step is to edit the rage config. As you can read in the [https://wiki.rage.mp/index.php?title=Server_settings documentation], you need to insert the option “fastdl-host” in your config file. | ||
Revision as of 08:15, 18 May 2020
What is FastDL?
FastDL is a technology which can receive files from another server. The major advantage of doing this is balancing the network.
FastDL in 0.3.7
Unlike usingFastDL with MTA or Counter Strike, when used with Rage it is slightly different, which makes the setup process more difficult.
Setting up FastDL
For the first step, you need to "cook" the web server that will be distributing the files.
You need to create a VirtualHost ( in nginx, we will call it "server" ) In the root of this VirtualHost, you need to make two directories. “file” and “list”.
Here is an example configuration:
server {
listen 80;
listen [::]:80;
root /var/www/rage-cache;
index index.html index.htm index.nginx-debian.html;
# server_name my.domain.com 127.0.0.1 other.domain.net;
server_name IP;
# use access log only for debug
access_log /var/log/nginx/cache_acces;
location / {
autoindex on;
}
}
Tip: You can use the "autoload on" feature when setting up, this helps with debugging.
The next step isto place the files in the directory.
Script
The author of the article recommends using his script:
wget https://raw.githubusercontent.com/Disinterpreter/rage-fastdl-manager/master/main.pl
Making the config
{
"host": "http://serverip:22006",
"cache-path": "/var/www/cache"
}
ATTENTION: cache-path must contain the path to the root of your cache directory.
Great! You have downloaded the script and written the config. Now you can turn on your server (if it was disabled) and then run our script with the command "sh ./main.pl"
Pay attention: On a debian-like OS you need to install the following packages: libjson-perl libtest-lwp-useragent-perl libfile-slurp-perl
For other operating systems, you can use cpan install JSON LWP::UserAgent File::Slurp
If you don’t want to use the script
When the client is joining the server, it makes the following request to the Fast-DL server: "GET /list" which may respond with something like id:name:hash. After that, it sorts the files and starts to download them, as follows:
GET /file/0
GET /file/1
GET /file/2
...
You can also make your own script if you are a programmer.
After launching the program, it takes the files automatically and puts them in the necessary directory of the web-server.
Tip: You can check these files if you go to the link in your browser (if your "autoload" was enabled)
RAGE Server
Finally, the last step is to edit the rage config. As you can read in the documentation, you need to insert the option “fastdl-host” in your config file.
Example:
{
...
"fastdl-host": IPADDRESS
}
Then restart the server.
ATTENTION: The Author of the article recommends syncing the files (executing ./main.pl) after each server restart.
Known problems
The new client (prerelease branch or 1.0) does not work well with Fast-DL, but version 0.3.7 does work well.
If you will be write your script, remember, GET /list receive only 2xx codes.