Skip to content

Follow the proxy selected for a redirect or replay - #2408

Merged
hyperxpro merged 1 commit into
mainfrom
fix/redirect-proxy-reselect
Nov 25, 2026
Merged

hyperxpro merged 1 commit into
mainfrom
fix/redirect-proxy-reselect

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:

The proxy is selected again for every attempt, but a reused future keeps the proxy and proxy realm of the previous one. After a redirect from a proxied http URL to an https URL reached directly, the request is written without TLS. When the selector answers with another proxy, that proxy receives the previous proxy's Proxy-Authorization.

Modification:

NettyRequestSender#sendRequest moves the future to the selected proxy before a connection is chosen, starts from that proxy's own realm and drops a carried Proxy-Authorization. An attempt that holds a channel, answers a 401 or 407, or enters a tunnel just opened stays on its proxy.

Result:

TLS, CONNECT and the pool key follow the route actually taken, and a proxy's credentials reach only that proxy.

@hyperxpro
hyperxpro merged commit 680c2a4 into main Nov 25, 2026
17 checks passed
@hyperxpro
hyperxpro deleted the fix/redirect-proxy-reselect branch November 25, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant