Files
ttstd-infinite-canvas/backend/internal/app/channel_outbound.go
dxiaom 872ab12dd6 fix(admin): 渠道代理 - 校验代理地址并拒绝无效出口
PR: #717
PR 标题: feat(admin): 渠道管理 - 模型供应商支持渠道级 SOCKS5/HTTP 代理

校验渠道级代理地址并在历史无效配置下拒绝出站请求,保留空代理回退全局代理的行为,同时补充管理端和出站层回归测试。

Co-authored-by: ddcat666 <26564566+ddcat666@users.noreply.github.com>
2026-10-10 05:44:48 +08:00

20 lines
686 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/socks5h/http/https),否则回退到全局客户端。
func (s *Service) OutboundHTTPClientForChannel(timeout time.Duration, _ *url.URL, proxyURL string) *http.Client {
return OutboundHTTPClientWithProxy(timeout, proxyURL)
}