feat: support system proxy (#515)

This commit is contained in:
Levi authored and GitHub committed 2024-05-01 18:53:12 +08:00
1 parent 070db64ca9
commit cea454b015
30 files changed
+324 -145

No files matched your search

+3 -4
View File
@@ -451,12 +451,11 @@ func (f *Fetcher) splitChunk() (chunks []*chunk) {
}
func (f *Fetcher) buildClient() *http.Client {
transport := &http.Transport{}
transport := &http.Transport{
Proxy: f.ctl.ProxyConfig.ToHandler(),
}
// Cookie handle
jar, _ := cookiejar.New(nil)
if f.ctl.ProxyUrl != nil {
transport.Proxy = http.ProxyURL(f.ctl.ProxyUrl)
}
return &http.Client{
Transport: transport,
Jar: jar,