Skip to content

feat(rust): reach the endpoint through an HTTP CONNECT proxy - #712

Draft
wkirschenmann wants to merge 2 commits into
wk/feat/rust-proxy-typesfrom
wk/feat/rust-proxy-connector
Draft

wkirschenmann wants to merge 2 commits into
wk/feat/rust-proxy-typesfrom
wk/feat/rust-proxy-connector

Conversation

@wkirschenmann

Copy link
Copy Markdown
Contributor

Motivation

The proxy configuration types exist; nothing dials the proxy they describe.

Description

A ProxyConnector between the TCP connector and the TLS one. It opens an HTTP CONNECT tunnel,
so TLS, mutual TLS included, is negotiated end to end with the real server and the proxy only
forwards opaque bytes. The handshake itself is hyper_util's Tunnel, not code written here.

The route is prepared once at construction, Proxy-Authorization value included. The connector
dials the proxy itself and hands Tunnel the connected stream, so failing to reach the proxy is
classified as such by construction rather than by matching upstream error text; only the 407 hint
still rests on the rendered message, and an integration test pins that wording.
ProxyError::find_in walks a returned error's source chain, so a caller can react to
AuthenticationRequired by prompting for credentials instead of string-matching. The dial is
bounded by the connector's own connect timeout and the handshake by the same configured knob,
30 seconds when none is set.

Testing

cargo test -p armonik-transport --all-features: 50 passed, of which 8 drive a real client
through a real CONNECT proxy to a real gRPC server over loopback sockets: the tunnel,
credentials demanded, presented, in the URL, missing and wrong, an unreachable proxy, proxying
off, and a proxy that goes quiet. The run is in the commit message.

Impact

No behaviour change: the default stays a direct connection, and the connector delegates straight
through when proxying is off. hyper-util gains the client-legacy and tokio features, both
already enabled transitively and now named; tokio (net, time) and tower-service become regular
dependencies of the crate.

Additional Information

Stacks on wk/feat/rust-proxy-types; merge that first.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI. (locally yes; CI runs on this PR)
  • I have assessed the performance impact of my modifications.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1478 1247 84% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: a301086 by action🐍

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 999fb068d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rust/armonik-transport/src/proxy.rs
@wkirschenmann
wkirschenmann force-pushed the wk/feat/rust-proxy-connector branch from 94a79c7 to 9429805 Compare August 7, 2026 11:40
@wkirschenmann
wkirschenmann force-pushed the wk/feat/rust-proxy-connector branch from 9429805 to cd27110 Compare August 8, 2026 14:23
A ProxyConnector between the TCP connector and the TLS one. It opens an
HTTP CONNECT tunnel, so TLS, mutual TLS included, is negotiated end to
end with the real server and the proxy only forwards opaque bytes. The
handshake itself is hyper_util's Tunnel, not one written here.

The route is prepared once at construction, Proxy-Authorization value
included, so a connection pays no route work when the route cannot
change. The connector dials the proxy itself and hands Tunnel the
connected stream, so failing to reach the proxy is classified as such
by construction rather than by matching upstream error text; only the
407 hint still rests on the rendered message, and an integration test
pins it. ProxyError::find_in walks a returned error's source chain, so
a caller can react to a proxy failure, prompting for credentials on
AuthenticationRequired, without string matching. The dial is bounded
by the connector's own connect timeout and the handshake by the same
configured knob, 30 seconds when none is set.

No behaviour change: the default stays a direct connection, and the
connector delegates straight through when proxying is off.

cargo test -p armonik-transport --all-features: 50 passed, 0 failed.
cargo clippy -p armonik-transport --all-features --all-targets: clean.
cargo fmt --check, which CI runs, rejects the one-line form.
@wkirschenmann
wkirschenmann force-pushed the wk/feat/rust-proxy-connector branch from cd27110 to a301086 Compare August 9, 2026 08:37
@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2026

Copy link
Copy Markdown

@wkirschenmann
wkirschenmann marked this pull request as draft August 13, 2026 18:50
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