Add HTTP proxy support for URL downloads - #919
Open
rudimaulfurz wants to merge 1 commit into
Open
rudimaulfurz wants to merge 1 commit into
rudimaulfurz wants to merge 1 commit into
Conversation
Add configurable HTTP forward-proxy support to WebDownloader while keeping NNTP/news-server connections completely unchanged and direct. - Add UrlProxyHost, UrlProxyPort, UrlProxyUsername, UrlProxyPassword and UrlProxyBypass configuration options. - Route HTTP URL downloads through the proxy using absolute-form request targets. - Route HTTPS downloads through an HTTP CONNECT tunnel and start TLS against the original target host, preserving origin SNI and certificate verification. - Support HTTP Basic proxy authentication without forwarding Proxy-Authorization credentials to tunneled origin servers. - Re-evaluate proxy and bypass selection for every URL, including redirected downloads. - Support bypass rules for exact hostnames, literal IP addresses, .domain suffixes, *.domain wildcards and IPv4 CIDR networks. - Accept comma- or semicolon-separated bypass rules with surrounding whitespace ignored. - Avoid local DNS resolution solely for bypass matching, preserving proxy-side DNS resolution for external hostnames. - Validate the configured proxy port when a proxy host is enabled. - Add configuration documentation and generated WebUI locale metadata for all new proxy settings. The proxy applies only to WebDownloader traffic such as URL, RSS and NZB HTTP/HTTPS fetches. NNTP connections are not routed through the proxy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add configurable HTTP forward-proxy support to WebDownloader.
NNTP/news-server connections stay completely unchanged and direct.
Some indexers do not allow NZB files to be downloaded and handed over to the download client. They only permit passing a URL, so the client has to follow the link (often via a local meta-search like NZBHydra2 that then redirects to the external indexer). The new proxy options make that flow work cleanly: local/Hydra URLs can be bypassed while the redirected external request goes through the HTTP proxy.
The proxy only applies to WebDownloader traffic (URL, RSS and NZB HTTP/HTTPS fetches). NNTP is not routed through it.
AI assistance
Tool: ChatGPT
Used for: design discussion, implementation help, test planning/automation, code review and commit preparation
Lib changes
None.
Testing
Testing during development / build and afterwards
QA Instructions / acceptance notes
For UrlProxyBypass
NZBGet-specific acceptance
NZBHydra2 test scenario
NZBHydra2 must be set to send NZBGet a link (not the NZB contents) and use access type Redirect:
/getnzb/...URLHydra should advertise a reachable LAN URL (prefer IP over a local-only hostname), e.g.
http://192.168.x.x:5076.In NZBGet put that network into
UrlProxyBypass, e.g.192.168.0.0/16. The external indexer must not match the bypass list so the redirected request goes through the proxy.Hydra’s own outbound proxy settings are independent. If Hydra itself uses a proxy, exclude local addresses there as well (
proxyIgnoreLocal: trueis typical).Expected flow:
Proxy log should contain the external indexer request but not the local Hydra request.
Platform/build acceptance already covered
For final acceptance, the most important manual check is
On the final build, set a LAN/Hydra bypass rule and verify the local Hydra request is absent from the proxy log while the redirected external indexer request is present.