feat: add outbound proxy support (socks5/http) for restricted networks

This commit is contained in:
Quorinex
2026-05-11 21:40:45 +08:00
parent 221348b975
commit 404e2425fa
9 changed files with 205 additions and 42 deletions

View File

@@ -57,7 +57,7 @@ func StartBuilderIdLogin(region string) (*BuilderIdSession, error) {
regReq, _ := http.NewRequest("POST", oidcBase+"/client/register", bytes.NewReader(regBody))
regReq.Header.Set("Content-Type", "application/json")
client := httpClient
client := httpClient()
regResp, err := client.Do(regReq)
if err != nil {
return nil, fmt.Errorf("register client failed: %v", err)
@@ -175,7 +175,7 @@ func PollBuilderIdAuth(sessionID string) (accessToken, refreshToken, clientID, c
tokenReq, _ := http.NewRequest("POST", oidcBase+"/token", bytes.NewReader(tokenBody))
tokenReq.Header.Set("Content-Type", "application/json")
client := httpClient
client := httpClient()
tokenResp, err := client.Do(tokenReq)
if err != nil {
return "", "", "", "", "", 0, "", fmt.Errorf("token request failed: %v", err)