FastDL
FastDL
FastDL is a technology which can receive files from another server. The major advantage of doing this is balancing the network.
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 "autoindex 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 (create a config.json file nearby)
{
"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": "domain"
}
Then restart the server.
ATTENTION: The Author of the article recommends syncing the files (executing ./main.pl) after each server restart.