-
Notifications
You must be signed in to change notification settings - Fork 873
Open
Description
Description
gws commands fail in environments requiring HTTP proxy (e.g., users in China who need proxy to access Google APIs).
Problem
The underlying yup-oauth2 and hyper HTTP clients don't respect standard proxy environment variables (http_proxy, https_proxy, ALL_PROXY).
Affected operations:
gws auth login- OAuth token exchange fails- All API calls - token refresh fails
Error message:
{
"error": {
"code": 401,
"message": "Authentication failed: Failed to get token: Connection failure: Hyper error: client error (Connect): tcp connect error: Operation timed out (os error 60)",
"reason": "authError"
}
}
Environment
- macOS 14.x (Sonoma)
- gws 0.11.1
- Proxy: http://127.0.0.1:7890
Current Workaround
- Manually exchange OAuth code using curl with proxy
- Save credentials to
~/.config/gws/credentials.json - Use
GOOGLE_WORKSPACE_CLI_TOKENenv var with manually refreshed access token
This is cumbersome as tokens expire every hour.
Suggested Fix
Option 1: Use reqwest with default features (includes proxy support):
# Cargo.toml - current
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls-native-roots"], default-features = false }
# Suggested - enable proxy support
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls-native-roots", "socks"] }Option 2: Pass a custom hyper client with proxy support to yup-oauth2 using .with_hyper_client().
Option 3: Add explicit --proxy flag or GWS_PROXY / GWS_HTTPS_PROXY environment variable.
References
- reqwest proxy support: https://docs.rs/reqwest/latest/reqwest/struct.Proxy.html
- yup-oauth2 custom client support
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels