Skip to content

Commit 8415c4d

Browse files
authored
Merge pull request chaitin#294 from ptonlix/feat/suport-proxy-access
feat(proxy): 添加环境变量代理支持
2 parents 38be50d + 9b00ab5 commit 8415c4d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

backend/internal/model/usecase/model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func NewModelUsecase(
3636
MaxIdleConnsPerHost: 100,
3737
MaxConnsPerHost: 100,
3838
IdleConnTimeout: time.Second * 30,
39+
Proxy: http.ProxyFromEnvironment,
3940
},
4041
}
4142
return &ModelUsecase{repo: repo, cfg: cfg, logger: logger, client: client}

backend/internal/proxy/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func NewLLMProxy(
5858
MaxConnsPerHost: cfg.LLMProxy.ClientPoolSize,
5959
MaxIdleConnsPerHost: cfg.LLMProxy.ClientPoolSize,
6060
IdleConnTimeout: 24 * time.Hour,
61+
Proxy: http.ProxyFromEnvironment,
6162
DialContext: (&net.Dialer{
6263
Timeout: 30 * time.Second,
6364
KeepAlive: 24 * time.Hour,

0 commit comments

Comments
 (0)