Repository navigation
feat(client): support SOCKS4/4a/5/5h proxies - #518
Conversation
316a75a to
150a6ed
Compare
150a6ed to
a10f22e
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Low
Looks good, with 1 low concern. The scheme allow-list, userinfo redaction, the hyper-util minimum and the test fixtures are solid, and the tests cover DNS mode, fail-closed behaviour and environment-variable precedence.
21a191b to
c7fc632
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Low
Looks good, with 1 low concern. The scheme allow-list, credential redaction and non-retryable SOCKS auth failures are consistent across the kernel, ADBC and C ABI, and well tested with the loopback fixture. The one gap is the napi binding docs, which still say only http/https proxies work.
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
✅ No issues identified.
🔀 1 finding considered and dismissed by the judge
- 🔵 Low
src/client/http.rs:791— Whenurlis None andHTTPS_PROXY/ALL_PROXYuses an unsupported scheme such as baresocks://, the kernel skips the proxy and connects directly without lo
Judge's evidence:Proxy::all(proxy_url).map_err(|e| {
Enable reqwest's `socks` feature and accept socks4://, socks4a://, socks5:// and socks5h:// proxy URLs, explicit or from HTTPS_PROXY / ALL_PROXY, next to http(s)://. socks5/socks4 resolve the target locally and socks5h/socks4a at the proxy; SOCKS5 credentials use RFC 1929, and a rejected SOCKS5 authentication is not retried. An explicit bare socks:// or other scheme is rejected; in the environment, unsupported schemes are ignored. Proxy userinfo is redacted in errors, logs and Debug output. The Rust ADBC driver's adbc.databricks.proxy.url accepts the same SOCKS schemes. Bump hyper-util 0.1.20 -> 0.1.21 in the root, napi and pyo3 lockfiles, and require it in Cargo.toml: 0.1.20 writes a malformed SOCKS4/4a CONNECT request. This adds base64 0.23.1 to those lockfiles; every lockfile, adbc's included, gains the kernel's direct hyper-util entry. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: cat23123 <58714163+cat23123@users.noreply.github.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Nit
Looks good — no blocking issues found. The scheme allow-list, redaction (http.rs and config.rs Debug), the non-retryable SOCKS auth classification (exercised against real hyper-util via the fixture), and the env and child-process coverage all look correct and well tested.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- ⚪ Nit — The env-proxy test table has no case for an unsupported-scheme env var such as
socks://. The docs promise that value is ignored, so the kernel falls back toALL_PROXYor connects directly, and that is untested. Add child-process cases for an unsupportedHTTPS_PROXYwith a validALL_PROXYand with none. (Found by GPT-6.1 Sol · confirmed by the judge)
aakash-saravanan-db
left a comment
There was a problem hiding this comment.
Thanks for the fixes! The shared transport implementation and focused coverage look good. Approving with the documented SOCKS4/4a USERID limitation accepted for follow-up, as noted in the existing thread.
This review was generated with GitHub MCP.
Summary
Adds SOCKS proxy support to the kernel's shared HTTP client, so SQL requests, CloudFetch downloads and OAuth use the same tunnel.
ProxyConfig.url, the Rust ADBC driver'sadbc.databricks.proxy.url, andHTTPS_PROXY/ALL_PROXYacceptsocks4://,socks4a://,socks5://andsocks5h://next tohttp(s)://.socks5/socks4resolve the target host locally;socks5h/socks4alet the proxy resolve it.socks://, fails withInvalidArgument. In environment variables, an unsupported scheme is ignored, so reqwest falls back toALL_PROXYor connects directly.Debugoutput.ProxyConfigfields, defaults and the C ABI are unchanged.Dependencies
socksfeature is implemented by hyper-util, which is already a dependency, so there's no new crate.napi/andpyo3/lockfiles, because 0.1.20 writes a malformed SOCKS4/4a CONNECT request.Cargo.tomlnow requireshyper-util >= 0.1.21, so downstream lockfiles get the fix too.base64 v0.23.1(MIT OR Apache-2.0) next to 0.22.1. 0.1.21 also validates HTTP proxy CONNECT responses more strictly; the existing HTTP-proxy tests pass.Validation
cargo fmtandclippy -D warningspass on both backends, as do the workspace,napi/,pyo3/andadbc/tests andcargo deny.NO_PROXYandbypass_hosts, and a 200,000-row CloudFetch query;SELECT 1throughsocks5hwas within 50 ms of direct.This pull request and its description were written by Isaac.