feat: add HTTP proxy support via environment variables#423
feat: add HTTP proxy support via environment variables#423femto wants to merge 2 commits intogoogleworkspace:mainfrom
Conversation
When http_proxy/https_proxy/all_proxy environment variables are set, use reqwest (which natively supports proxy) for token refresh instead of yup-oauth2's hyper-based client (which doesn't support proxy). This enables gws to work in environments that require HTTP proxy to access Google APIs (e.g., users in China). Changes: - Cargo.toml: Enable reqwest's default features including proxy support - src/auth.rs: Add proxy-aware token refresh using reqwest as fallback Fixes googleworkspace#422 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
When proxy env vars are set, use a custom OAuth flow with reqwest for token exchange instead of yup-oauth2's hyper-based client. Changes to auth_commands.rs: - Add login_with_proxy_support() for proxy-aware OAuth login - Add exchange_code_with_reqwest() for token exchange via reqwest - Detect proxy env vars and choose appropriate flow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/gemini review |
|
@google-cla check |
Summary
When
http_proxy/https_proxy/all_proxyenvironment variables are set, usereqwest(which natively supports proxy) for token refresh instead ofyup-oauth2'shyper-based client (which doesn't support proxy).This enables
gwsto work in environments that require HTTP proxy to access Google APIs (e.g., users in China).Changes
reqwest's default features including proxy and SOCKS supporthas_proxy_env()helper to detect proxy environment variablesrefresh_token_with_reqwest()for proxy-aware token refreshreqwestdirectly instead of waiting foryup-oauth2's hyper client to timeoutTesting
Tested in an environment requiring HTTP proxy:
Without this change, the command would hang waiting for hyper's connection timeout, then fail.
Fixes #422