mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-09 18:10:29 +00:00
feat: support proxy from system env
This commit is contained in:
1 parent
f8ea009fe9
commit
82b6ebd6f1
17 files changed
+175
-97
No files matched your search
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/GopeedLab/gopeed/internal/fetcher"
|
||||
"github.com/GopeedLab/gopeed/pkg/base"
|
||||
fhttp "github.com/GopeedLab/gopeed/pkg/protocol/http"
|
||||
"github.com/GopeedLab/gopeed/pkg/util"
|
||||
"github.com/xiaoqidun/setft"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"io"
|
||||
@@ -455,7 +454,7 @@ func (f *Fetcher) buildClient() *http.Client {
|
||||
transport := &http.Transport{}
|
||||
// Cookie handle
|
||||
jar, _ := cookiejar.New(nil)
|
||||
transport.Proxy = util.ProxyUrlToHandler(f.ctl.ProxyUrl)
|
||||
transport.Proxy = f.ctl.ProxyConfig.ToHandler()
|
||||
return &http.Client{
|
||||
Transport: transport,
|
||||
Jar: jar,
|
||||
|
||||
Reference in new issue
Block a user