MCPcopy
hub / github.com/Wei-Shaw/sub2api / HTTPUpstream

Interface HTTPUpstream

backend/internal/service/http_upstream_port.go:11–24  ·  view source on GitHub ↗

HTTPUpstream 上游 HTTP 请求接口 用于向上游 API(Claude、OpenAI、Gemini 等)发送请求

Source from the content-addressed store, hash-verified

9// HTTPUpstream 上游 HTTP 请求接口
10// 用于向上游 API(Claude、OpenAI、Gemini 等)发送请求
11type HTTPUpstream interface {
12 // Do 执行 HTTP 请求(不启用 TLS 指纹)
13 Do(req *http.Request, proxyURL string, accountID int64, accountConcurrency int) (*http.Response, error)
14
15 // DoWithTLS 执行带 TLS 指纹伪装的 HTTP 请求
16 //
17 // profile 参数:
18 // - nil: 不启用 TLS 指纹,行为与 Do 方法相同
19 // - non-nil: 使用指定的 Profile 进行 TLS 指纹伪装
20 //
21 // Profile 由调用方通过 TLSFingerprintProfileService 解析后传入,
22 // 支持按账号绑定的数据库 profile 或内置默认 profile。
23 DoWithTLS(req *http.Request, proxyURL string, accountID int64, accountConcurrency int, profile *tlsfingerprint.Profile) (*http.Response, error)
24}

Callers 16

checkColumnFunction · 0.65
ClientMethod · 0.65
withAPIKeyIDFunction · 0.65
withAccountIDFunction · 0.65
withAnnouncementIDFunction · 0.65
ForwardAsResponsesMethod · 0.65
ForwardMethod · 0.65

Implementers 15

httpUpstreamRecorderbackend/internal/service/openai_oauth_
failingOpenAIHTTPUpstreambackend/internal/service/openai_upstre
epFixedUpstreambackend/internal/service/error_policy_
recordingOKUpstreambackend/internal/service/antigravity_r
stubAntigravityUpstreambackend/internal/service/antigravity_r
httpUpstreamStubbackend/internal/service/antigravity_g
queuedHTTPUpstreamStubbackend/internal/service/antigravity_g
httpUpstreamSequenceRecorderbackend/internal/service/openai_ws_pro
mockSmartRetryUpstreambackend/internal/service/antigravity_s
anthropicHTTPUpstreamRecorderbackend/internal/service/gateway_anthr
queuedHTTPUpstreambackend/internal/service/account_test_
geminiCompatHTTPUpstreamStubbackend/internal/service/gemini_messag

Calls

no outgoing calls

Tested by

no test coverage detected