mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-11-12 12:17:23 +00:00
docs: 中性化 README 与代码注释中的第三方客户端引用
- README.md / README_EN.md:桌面 GUI 段落的第三方客户端类比改为中性的「托盘式桌面客户端」,功能说明不变 - cmd/gui 注释、internal/provider 注释:代理示例改为中性的本地 HTTP 代理表述 - internal/lua/plugins/channels.lua、internal/lua/vm.go:注释措辞中性化 仅文案与注释调整,无任何逻辑变更。
This commit is contained in:
@ -7793,7 +7793,7 @@ plugin.http = {
|
||||
|
||||
-- set_endpoints:改写某平台的端点声明(device.code_url/token_url、checkin.url、
|
||||
-- base_url)。两个用途:
|
||||
-- 1. 运维把某渠道指向自建代理/镜像(厂商被墙、企业出口、审计要求)
|
||||
-- 1. 运维把某渠道指向自建代理/镜像(网络出口受限、企业出口、审计要求)
|
||||
-- 2. 测试把端点指到假上游,行为测试才能不打真厂商
|
||||
-- 只允许改已知字段,未知键拒绝 —— 端点声明是协议形状的一部分,静默加字段
|
||||
-- 会破坏后续逻辑对形状的假设。
|
||||
|
||||
@ -41,7 +41,7 @@ import (
|
||||
var bundledAdapters embed.FS
|
||||
|
||||
// adapterGlobal is the reserved global holding the adapter table after the
|
||||
// worker boots the script. A reserved name avoids clashing with user code.
|
||||
// worker boots the script. A reserved name avoids conflicting with user code.
|
||||
const adapterGlobal = "__llmsproxy_adapter"
|
||||
|
||||
type APIAdapter struct {
|
||||
|
||||
@ -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