在前一篇文章中,我們搭建了通過外網(wǎng)域名訪問內(nèi)網(wǎng)路由器后臺(tái)的功能,其實(shí)在此基礎(chǔ)上,可以很容易的搭建aria2遠(yuǎn)程下載功能。
前提
搭建好了aria2內(nèi)網(wǎng)下載環(huán)境
實(shí)現(xiàn)
我們搭建好aria2內(nèi)網(wǎng)下載環(huán)境后,會(huì)發(fā)現(xiàn),aria2的配置信息,是通過6800端口的jsonrpc路由進(jìn)行提供的,我們要做的就是把這一接口暴露出去。
還是使用frp來完成任務(wù)
frpc客戶端配置,我們?cè)趂rpc.ini中增加下面的配置
<pre>
[aria2_rpc]
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 6800
use_gzip = true
connections will be established in advance, default value is zero
pool_count = 20
http username and password are safety certification for http protocol
if not set, you can access this custom_domains without certification
http_user = admin
http_pwd = admin
if domain for frps is frps.com, then you can access [web01] proxy by URL http://test.frps.com
subdomain = aria2
</pre>
nginx配置
<pre>
server {
listen 80 ;
listen [::]:80 ;
server_name aria2.xxx.com;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
</pre>
此時(shí)我們?cè)L問aria2.xxx.com/jsonrpc,就相當(dāng)于訪問了localhost:6800/jsonrpc
此時(shí)我們把a(bǔ)ria2.xxx.com/jsonrpc填到隨便一個(gè)在線的aria2管理器,都可以遠(yuǎn)程管理下載了。