- ModelChannel 新增 proxy_url 字段,v48 迁移自动加列 - outbound 新增 OutboundHTTPClientWithProxy,socks5/socks5h/http/https 均支持; 目标主机名不做本地解析,直接交给代理服务器远端解析,本地开启 TUN/VPN 时仍可用 - 系统代理、Provider 出站、管理员模型测试路径均使用渠道级代理 - 渠道管理表单新增"代理地址"输入框,留空回退全局代理
20 lines
678 B
Go
20 lines
678 B
Go
package app
|
||
|
||
import (
|
||
"net/http"
|
||
"net/url"
|
||
"time"
|
||
)
|
||
|
||
// ValidateChannelOutboundURL keeps all provider channels on the server-side
|
||
// outbound policy. Local desktop endpoints are intentionally unsupported.
|
||
func (s *Service) ValidateChannelOutboundURL(rawURL string) (*url.URL, error) {
|
||
return ValidateOutboundURL(rawURL)
|
||
}
|
||
|
||
// OutboundHTTPClientForChannel 返回渠道专用的出站 HTTP 客户端。
|
||
// proxyURL 非空时使用渠道级代理(socks5/http/https),否则回退到全局客户端。
|
||
func (s *Service) OutboundHTTPClientForChannel(timeout time.Duration, _ *url.URL, proxyURL string) *http.Client {
|
||
return OutboundHTTPClientWithProxy(timeout, proxyURL)
|
||
}
|