mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-11-07 09:47:23 +00:00
docs(provider): 中性化传输代理注释里的第三方客户端表述
`internal/provider/provider.go` 的两处注释用第三方客户端名作代理示例 (`clash on 127.0.0.1:7890`)。改成中性的「a local HTTP proxy on 127.0.0.1:7890」,语义不变:仍然是在说明 per-source `proxy_url` 的用途。 上一轮中性化只做了大小写敏感的 `Clash` 扫描,漏掉了这两处小写; 本次改用 `-i` 全仓复查,源码/文档/打包内已无该表述(`clashing`、 `diverge` 这类同形词不属此列)。
This commit is contained in:
@ -26,9 +26,9 @@ import (
|
||||
)
|
||||
|
||||
// proxyFor picks the transport proxy for one source. An explicit per-source
|
||||
// proxy_url wins (e.g. clash on 127.0.0.1:7890 for a geo-blocked upstream);
|
||||
// otherwise fall back to the process-wide env proxy, which is direct by
|
||||
// default.
|
||||
// proxy_url wins (e.g. a local HTTP proxy on 127.0.0.1:7890 for an upstream
|
||||
// that is only reachable through it); otherwise fall back to the
|
||||
// process-wide env proxy, which is direct by default.
|
||||
func proxyFor(cfg config.Source) func(*http.Request) (*url.URL, error) {
|
||||
if cfg.ProxyURL != "" {
|
||||
proxyURL, err := url.Parse(cfg.ProxyURL)
|
||||
@ -403,9 +403,10 @@ func New(cfg config.Source, vm *lua.VM) *Provider {
|
||||
// Shared transport: ResponseHeaderTimeout bounds how long we wait for the
|
||||
// first response byte (applies to both paths); the stream client has no
|
||||
// client-level Timeout so the SSE body can run past the header timeout.
|
||||
// A per-source ProxyURL (e.g. clash on 127.0.0.1:7890) overrides the
|
||||
// process-wide env proxy for upstreams that are geo/IP-blocked; sources
|
||||
// without one keep http.ProxyFromEnvironment (direct by default).
|
||||
// A per-source ProxyURL (e.g. a local HTTP proxy on 127.0.0.1:7890)
|
||||
// overrides the process-wide env proxy for upstreams that need an explicit
|
||||
// egress path; sources without one keep http.ProxyFromEnvironment (direct
|
||||
// by default).
|
||||
tr := &http.Transport{
|
||||
Proxy: proxyFor(cfg),
|
||||
DialContext: (&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext,
|
||||
|
||||
Reference in New Issue
Block a user