MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / NewCodexAuthWithProxyURL

Function NewCodexAuthWithProxyURL

internal/auth/codex/openai_auth.go:48–61  ·  view source on GitHub ↗

NewCodexAuthWithProxyURL creates a new CodexAuth service instance. proxyURL takes precedence over cfg.ProxyURL when non-empty.

(cfg *config.Config, proxyURL string)

Source from the content-addressed store, hash-verified

46// NewCodexAuthWithProxyURL creates a new CodexAuth service instance.
47// proxyURL takes precedence over cfg.ProxyURL when non-empty.
48func NewCodexAuthWithProxyURL(cfg *config.Config, proxyURL string) *CodexAuth {
49 effectiveProxyURL := strings.TrimSpace(proxyURL)
50 var sdkCfg config.SDKConfig
51 if cfg != nil {
52 sdkCfg = cfg.SDKConfig
53 if effectiveProxyURL == "" {
54 effectiveProxyURL = strings.TrimSpace(cfg.ProxyURL)
55 }
56 }
57 sdkCfg.ProxyURL = effectiveProxyURL
58 return &CodexAuth{
59 httpClient: util.SetProxy(&sdkCfg, &http.Client{}),
60 }
61}
62
63// GenerateAuthURL creates the OAuth authorization URL with PKCE (Proof Key for Code Exchange).
64// It constructs the URL with the necessary parameters, including the client ID,

Calls 1

SetProxyFunction · 0.92