jc3213 / download_with_aria2

The browser extenson for aria2 download utility via JSON-RPC
GNU Lesser General Public License v2.1
60 stars 8 forks source link

Fail to pass "all_proxy" parameter after auto capturing the download #38

Closed xtellaris closed 1 year ago

xtellaris commented 1 year ago

Environment

About the Issue

I try to download something in github release page, and the extension captured the link. But seems it did not pass it with the "all_proxy" setting to aria2, while I did set it in the extension's option page. The connection just ignored my proxy, so it was very slow.

And I also set "all_proxy" in aria2.conf, but it didn't work either.

here's the screenshots:

Aria2 Logs

aria2 logs after capturing:

2022-08-26 13:52:25.470407 [INFO] [HttpListenCommand.cc:77] RPC: Accepted the connection from 127.0.0.1:60560.
2022-08-26 13:52:25.470803 [INFO] [HttpServer.cc:186] HTTP Server received request
POST /jsonrpc HTTP/1.1
Host: localhost:6800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: text/plain;charset=UTF-8
Content-Length: 944
Origin: moz-extension://8721a64f-be5e-4bac-8874-91f88c113d90
DNT: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

2022-08-26 13:52:25.470974 [INFO] [rpc_helper.cc:103] Executing RPC method aria2.addUri
2022-08-26 13:52:25.471285 [INFO] [AbstractHttpServerResponseCommand.cc:117] CUID#34 - HttpServer: all response transmitted.
2022-08-26 13:52:25.471355 [INFO] [HttpServerResponseCommand.cc:60] CUID#34 - Persist connection.
2022-08-26 13:52:25.471473 [INFO] [AbstractCommand.cc:771] CUID#35 - DNS cache hit: objects.githubusercontent.com -> 185.199.110.133, 185.199.111.133, 185.199.108.133
2022-08-26 13:52:25.471489 [INFO] [HttpInitiateConnectionCommand.cc:123] CUID#35 - Connecting to 185.199.110.133:443
2022-08-26 13:52:25.690901 [INFO] [HttpConnection.cc:128] CUID#35 - Requesting:
GET /github-production-release-asset-2e65be/84901543/605a8c6c-b5e4-4b4f-98e5-887a8f8a7b97?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220826%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220826T055223Z&X-Amz-Expires=300&X-Amz-Signature=2bf9a3116a9eb32b568b72da8631c7ab3e6b4229721a11f870315c360f8c9502&X-Amz-SignedHeaders=host&actor_id=40926741&key_id=0&repo_id=84901543&response-content-disposition=attachment%3B%20filename%3DqBittorrent-Enhanced-Edition-x86_64.AppImage&response-content-type=application%2Foctet-stream HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Accept: */*,application/metalink4+xml,application/metalink+xml
Host: objects.githubusercontent.com
Referer: https://github.com/search?q=qbittorrent+enhanced
Want-Digest: SHA-512;q=1, SHA-256;q=1, SHA;q=0.1
Cookie:

2022-08-26 13:52:25.726073 [INFO] [HttpServer.cc:186] HTTP Server received request
POST /jsonrpc HTTP/1.1
Host: localhost:6800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: text/plain;charset=UTF-8
Content-Length: 79
Origin: moz-extension://8721a64f-be5e-4bac-8874-91f88c113d90
DNT: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

2022-08-26 13:52:25.726153 [INFO] [rpc_helper.cc:103] Executing RPC method aria2.tellActive
2022-08-26 13:52:25.726665 [INFO] [AbstractHttpServerResponseCommand.cc:117] CUID#34 - HttpServer: all response transmitted.
2022-08-26 13:52:25.726692 [INFO] [HttpServerResponseCommand.cc:60] CUID#34 - Persist connection.
2022-08-26 13:52:25.740498 [INFO] [HttpServer.cc:186] HTTP Server received request
POST /jsonrpc HTTP/1.1
Host: localhost:6800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: text/plain;charset=UTF-8
Content-Length: 86
Origin: moz-extension://8721a64f-be5e-4bac-8874-91f88c113d90
DNT: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

2022-08-26 13:52:25.740571 [INFO] [rpc_helper.cc:103] Executing RPC method aria2.tellWaiting
2022-08-26 13:52:25.740675 [INFO] [AbstractHttpServerResponseCommand.cc:117] CUID#34 - HttpServer: all response transmitted.
2022-08-26 13:52:25.740707 [INFO] [HttpServerResponseCommand.cc:60] CUID#34 - Persist connection.
2022-08-26 13:52:25.743682 [INFO] [HttpServer.cc:186] HTTP Server received request
POST /jsonrpc HTTP/1.1
Host: localhost:6800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: text/plain;charset=UTF-8
Content-Length: 86
Origin: moz-extension://8721a64f-be5e-4bac-8874-91f88c113d90
DNT: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

2022-08-26 13:52:25.743796 [INFO] [rpc_helper.cc:103] Executing RPC method aria2.tellStopped
2022-08-26 13:52:25.743903 [INFO] [AbstractHttpServerResponseCommand.cc:117] CUID#34 - HttpServer: all response transmitted.
2022-08-26 13:52:25.743919 [INFO] [HttpServerResponseCommand.cc:60] CUID#34 - Persist connection.
2022-08-26 13:52:25.759524 [INFO] [HttpListenCommand.cc:77] RPC: Accepted the connection from 127.0.0.1:60574.
2022-08-26 13:52:25.759692 [INFO] [HttpServer.cc:186] HTTP Server received request
GET /jsonrpc HTTP/1.1
Host: localhost:6800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Sec-WebSocket-Version: 13
Origin: moz-extension://8721a64f-be5e-4bac-8874-91f88c113d90
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: D64UlvaGgza4V41b6+S6RQ==
DNT: 1
Connection: keep-alive, Upgrade
Sec-Fetch-Dest: websocket
Sec-Fetch-Mode: websocket
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

2022-08-26 13:52:25.759828 [INFO] [AbstractHttpServerResponseCommand.cc:117] CUID#36 - HttpServer: all response transmitted.
2022-08-26 13:52:26.002917 [INFO] [HttpConnection.cc:163] CUID#35 - Response received:
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 24106176
Content-Type: application/octet-stream
Content-MD5: vh1pzwBeAFczlKYf/82LaQ==
Last-Modified: Fri, 26 Aug 2022 01:37:05 GMT
ETag: "0x8DA87037BD8A223"
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: de41c803-001e-0069-290f-b91b29000000
x-ms-version: 2020-04-08
x-ms-creation-time: Fri, 26 Aug 2022 01:37:05 GMT
x-ms-lease-status: unlocked
x-ms-lease-state: available
x-ms-blob-type: BlockBlob
Content-Disposition: attachment; filename=qBittorrent-Enhanced-Edition-x86_64.AppImage
x-ms-server-encrypted: true
Fastly-Restarts: 1
Accept-Ranges: bytes
Age: 68
Date: Fri, 26 Aug 2022 05:52:25 GMT
Via: 1.1 varnish
X-Served-By: cache-tyo11958-TYO
X-Cache: HIT
X-Cache-Hits: 0
X-Timer: S1661493146.720811,VS0,VE172
jc3213 commented 1 year ago

The Proxy Server set in options won't be added to all downloads, it should be used together with the Proxy Domain Rules as the Capturing rules

  1. You can just add domain.com into Proxy Domain Rules

  2. Or, you can click the button behind Proxy Server in TaskMgr window to apply the proxy server manually

Sorry that, this issue is due to the lack of documentary.

PS: Maybe options Proxy should be rebuilt like Capturing ? How do you think about it? @ivysrono

xtellaris commented 1 year ago

The Proxy Server set in options won't be added to all downloads, it should be used together with the Proxy Domain Rules as the Capturing rules

1. You can just add `domain.com` into `Proxy Domain Rules`

2. Or, you can click the button behind `Proxy Server` in `TaskMgr` window to apply the proxy server manually

Sorry that, this issue is due to the lack of documentary.

PS: Maybe options Proxy should be rebuilt like Capturing ? How do you think about it? @ivysrono

Thanks for the reply and the instructions. It is my fault for not reviewing all the settings carefully. I remember it would work in some old version of this good extension, and that's why I felt wired when proxy was ignored.

jc3213 commented 1 year ago

Thanks for the reply and the instructions. It is my fault for not reviewing all the settings carefully. I remember it would work in some old version of this good extension, and that's why I felt wired when proxy was ignored.

You may have just misremembered this extension as another one. The Proxy Server has always been a set with Proxy Domain Rules in this extension.

xtellaris commented 1 year ago

As "Proxy Domain Rules" works fine and smooth, I will close this issue. And maybe a global proxy option will be a good feature, because sometimes it's hard to decide which domain to be set in the rules after redirect.

jc3213 commented 1 year ago

As "Proxy Domain Rules" works fine and smooth, I will close this issue. And maybe a global proxy option will be a good feature, because sometimes it's hard to decide which domain to be set in the rules after redirect.

It is based on the referer header's hostname, currently

xtellaris commented 1 year ago

Thanks for the reply and the instructions. It is my fault for not reviewing all the settings carefully. I remember it would work in some old version of this good extension, and that's why I felt wired when proxy was ignored.

You may have just misremembered this extension as another one. The Proxy Server has always been a set with Proxy Domain Rules in this extension.

I've being use this extension even before v3.0.7, I do remember the traffic would go through the proxy in early versions. Anyway, maybe I just misunderstood something since then.

As "Proxy Domain Rules" works fine and smooth, I will close this issue. And maybe a global proxy option will be a good feature, because sometimes it's hard to decide which domain to be set in the rules after redirect.

It is based on the referer header's hostname, currently

Oh, that's make it clear. 👍🏻👍🏻👍🏻

ivysrono commented 1 year ago

其实我之前的用法是所有需要proxy的都加入忽略域名,交还给浏览器自己去解决。 毕竟本扩展对此并不专业。

jc3213 commented 1 year ago

I wonder if you can help me to test latest main branch code, sorry that I can't do any test until 17:30, or maybe later

xtellaris commented 1 year ago

I wonder if you can help me to test latest main branch code, sorry that I can't do any test until 17:30, or maybe later

I've tested the "Use proxy" option in all three mode(never/switch/always) with firefox, nothing wong I can tell. Should I send some logs to you? But I do not konw how to do it except loading temporary extensions.

xtellaris commented 1 year ago
jc3213 commented 1 year ago

It works, nor not? I've done my COVID PCR test but haven't returned home.

xtellaris commented 1 year ago

It works, nor not? I've done my COVID PCR test but haven't returned home.

Worked perfectly 👍🏻

ivysrono commented 1 year ago

I wonder if you can help me to test latest main branch code, sorry that I can't do any test until 17:30, or maybe later

我也才回家……

检测排长龙么

jc3213 commented 1 year ago

I wonder if you can help me to test latest main branch code, sorry that I can't do any test until 17:30, or maybe later

我也才回家……

检测排长龙么

排了2个半小时,检测点就1个人工作,排队的超过300,我离开的时候队伍比我刚到的时候还长,就感觉挺离谱的