feat: Add automated ChatGPT account registration with backend API, TLS client, and fingerprinting, alongside new frontend pages for configuration, monitoring, and upload.
This commit is contained in:
@@ -75,8 +75,18 @@ func (rt *utlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)
|
||||
return nil, fmt.Errorf("proxy dial error: %w", err)
|
||||
}
|
||||
|
||||
// 发送 CONNECT 请求
|
||||
connectReq := fmt.Sprintf("CONNECT %s HTTP/1.1\r\nHost: %s\r\n\r\n", targetHost, targetHost)
|
||||
// 构建 CONNECT 请求,支持代理认证
|
||||
connectReq := fmt.Sprintf("CONNECT %s HTTP/1.1\r\nHost: %s\r\n", targetHost, targetHost)
|
||||
|
||||
// 添加代理认证头
|
||||
if rt.proxyURL.User != nil {
|
||||
username := rt.proxyURL.User.Username()
|
||||
password, _ := rt.proxyURL.User.Password()
|
||||
auth := base64.StdEncoding.EncodeToString([]byte(username + ":" + password))
|
||||
connectReq += fmt.Sprintf("Proxy-Authorization: Basic %s\r\n", auth)
|
||||
}
|
||||
connectReq += "\r\n"
|
||||
|
||||
_, err = conn.Write([]byte(connectReq))
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
@@ -493,10 +503,10 @@ func (c *CodexAPIAuth) ObtainAuthorizationCode() (string, error) {
|
||||
return "", fmt.Errorf("密码验证失败: %d", resp.StatusCode)
|
||||
}
|
||||
c.logStep(StepInputPassword, "密码验证成功")
|
||||
|
||||
|
||||
// 解析密码验证响应
|
||||
json.Unmarshal(body, &data)
|
||||
|
||||
|
||||
// 检查下一步是什么
|
||||
nextPageType := ""
|
||||
if page, ok := data["page"].(map[string]interface{}); ok {
|
||||
@@ -504,7 +514,7 @@ func (c *CodexAPIAuth) ObtainAuthorizationCode() (string, error) {
|
||||
nextPageType = pt
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果需要邮箱验证,这是新账号的问题
|
||||
if nextPageType == "email_otp_verification" {
|
||||
c.logError(StepInputPassword, "账号需要邮箱验证,无法继续 Codex 授权流程")
|
||||
|
||||
Reference in New Issue
Block a user