glutton
glutton copied to clipboard
Support basic access authentication
在有 HTTP authentication 的情况下不能正常工作。
build.js:8 POST https://www.example.com/jsonrpc 401 (Unauthorized)i @ build.js:8t.default.methods.testConnection @ build.js:8(anonymous function) @ build.js:20t.default.methods.connectToServer @ build.js:8(anonymous function) @ build.js:20t.default.events.connectToServer @ build.js:8e.$emit @ build.js:21e.$dispatch @ build.js:21t.default.methods.connect @ build.js:8(anonymous function) @ build.js:20
Navigated to https://www.example.com/glutton/
应该是因为 rcp.call 时没有带上 Authorization:Basic xxxxxxxxxxxxxx 头信息
是的,请看 README.md,rpc-user 和 rpc-passwd 没有被支持。
不是说 aria2 的认证,是 http 服务器的认证。aria2c 已使用 SECRET TOKEN,外层的 nginx 代理还有一层 HTTP Basic Authentication
即 nginx 配置了 https://www.example.com/jsonrpc 需要 Authentication
nginx 配置
# aria2 jsonrpc
location /jsonrpc {
auth_basic "Authentication required";
auth_basic_user_file /etc/nginx/.dlpasswd;
proxy_pass http://127.0.0.1:6800;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
...明白了 感觉好多余啊,能别这么用不
Glutton 使用了 Fetch API,目前的标准是不支持 Basic access authentication 的,要改起来比较麻烦。
这也是不想支持 rpc-user 和 rpc-passwd 的原因。
webui-aria2 和 yaaw (ajax) 都可以正常工作的,没有这一层心里不踏实。
@NemoAlex 可以使用 fetch('http://user:[email protected]/jsonrpc') 这种方式试试
不用这么麻烦 可以用aria2自带证书功能