feat: add a new TLS client with browser fingerprinting and implement Codex API authentication.

This commit is contained in:
2026-02-06 17:44:29 +08:00
parent 1c1bdc3152
commit 4ac7290e1f
2 changed files with 84 additions and 148 deletions

View File

@@ -588,6 +588,15 @@ func (c *TLSClient) GetFingerprintInfo() string {
return fmt.Sprintf("%s/%s %s (%s)", typeName, fp.Browser, fp.Version, fp.Platform)
}
// GetHeadersInfo 获取指纹对应的 User-Agent、sec-ch-ua、sec-ch-ua-platform
// 供 codex_api 等外部模块使用,确保 headers 与 TLS 指纹一致
func (c *TLSClient) GetHeadersInfo() (userAgent, secChUa, secChPlatform string) {
userAgent = c.userAgent
secChUa = c.generateSecChUa()
secChPlatform = c.getPlatformHeader()
return
}
// Close 关闭客户端
func (c *TLSClient) Close() {
if c.azureSession != nil {