feat: add per-channel HTTP transport controls

This commit is contained in:
CaIon
2026-07-27 21:41:13 +08:00
parent b27b2b1d6f
commit e99a9bd86f
24 changed files with 1330 additions and 81 deletions
+3 -11
View File
@@ -48,17 +48,9 @@ func newAwsInvokeContext() (context.Context, context.CancelFunc) {
}
func newAwsClient(c *gin.Context, info *relaycommon.RelayInfo) (*bedrockruntime.Client, error) {
var (
httpClient *http.Client
err error
)
if info.ChannelSetting.Proxy != "" {
httpClient, err = service.GetHttpClientWithProxy(info.ChannelSetting.Proxy)
if err != nil {
return nil, fmt.Errorf("new proxy http client failed: %w", err)
}
} else {
httpClient = service.GetHttpClient()
httpClient, err := service.GetHttpClientWithProxySettings(info.ChannelSetting.Proxy, info.ChannelSetting)
if err != nil {
return nil, fmt.Errorf("new proxy http client failed: %w", err)
}
awsSecret := strings.Split(info.ApiKey, "|")