Files
ttstd-infinite-canvas/backend/internal/app/channel_outbound.go
dxiaom 8b0a8054e1 feat(admin): 渠道管理 - 模型供应商支持渠道级 SOCKS5/HTTP 代理
- ModelChannel 新增 proxy_url 字段,v48 迁移自动加列
- outbound 新增 OutboundHTTPClientWithProxy,socks5/socks5h/http/https 均支持;
  目标主机名不做本地解析,直接交给代理服务器远端解析,本地开启 TUN/VPN 时仍可用
- 系统代理、Provider 出站、管理员模型测试路径均使用渠道级代理
- 渠道管理表单新增"代理地址"输入框,留空回退全局代理
2026-10-10 00:59:37 +08:00

20 lines
678 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}