Skip to content

Add HTTPS proxy (CONNECT) support via env vars to gsheets extension#92

Closed
macraesdirtysocks wants to merge 2 commits into
evidence-dev:mainfrom
macraesdirtysocks:add_proxy_handling
Closed

Add HTTPS proxy (CONNECT) support via env vars to gsheets extension#92
macraesdirtysocks wants to merge 2 commits into
evidence-dev:mainfrom
macraesdirtysocks:add_proxy_handling

Conversation

@macraesdirtysocks

Copy link
Copy Markdown

Written with the help of ChatGPT-5

This PR adds minimal HTTPS proxy support to the custom OpenSSL HTTP client used by the gsheets DuckDB extension.

When HTTPS_PROXY (or HTTP_PROXY) is set (and host not excluded by NO_PROXY), requests to Sheets and OAuth endpoints are tunneled through the proxy using an HTTP CONNECT handshake, then TLS.

Key points:

  • Env vars honored: HTTPS_PROXY / HTTP_PROXY, NO_PROXY (case-insensitive)
  • Proxy URL format: http://[user:pass@]host:port
  • Supports Basic proxy auth (credentials in URL)
  • Falls back to direct connection if no proxy or host matches NO_PROXY
  • No changes to SQL surface or secret definitions

This PR is by no means a robust implementation but it works.

Does not:

  • Support windows
  • Only reads from env vars (secret does not take proxy params)

William OLeary added 2 commits October 18, 2025 10:33
A major update that adds HTTP/HTTPS proxy support for the DuckDB Google Sheets extension via environment variables (HTTP_PROXY,
HTTPS_PROXY, NO_PROXY).

Changes:

- Added 225+ lines implementing proxy support using HTTP CONNECT tunneling
- New proxy configuration structure with username/password support
- Environment variable parsing with NO_PROXY pattern matching
- Low-level POSIX socket operations for manual TCP connections
Added C++17 standard requirement to CMakeLists.txt to fix compilation
error with std::optional.
@mharrisb1

Copy link
Copy Markdown
Collaborator

Closing in favor of #102

@mharrisb1 mharrisb1 closed this Feb 12, 2026
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.

2 participants