@@ -19,6 +19,7 @@ import (
1919 "github.com/rclone/rclone/fs/config/configmap"
2020 "github.com/rclone/rclone/fs/config/configstruct"
2121 "github.com/rclone/rclone/fs/fserrors"
22+ "github.com/rclone/rclone/fs/fshttp"
2223 "github.com/rclone/rclone/fs/hash"
2324 "github.com/rclone/rclone/lib/cache"
2425 "github.com/rclone/rclone/lib/pacer"
@@ -72,6 +73,16 @@ The DOI provider can be set when rclone does not automatically recognize a suppo
7273 }},
7374 Required : false ,
7475 Advanced : true ,
76+ }, {
77+ Name : "proxy_url" ,
78+ Help : "Proxy URL" ,
79+ Required : false ,
80+ Advanced : true ,
81+ }, {
82+ Name : "proxy_ca_cert" ,
83+ Help : "Proxy CA certificate" ,
84+ Required : false ,
85+ Advanced : true ,
7586 }},
7687 }
7788 fs .Register (fsi )
@@ -91,8 +102,10 @@ const (
91102
92103// Options defines the configuration for this backend
93104type Options struct {
94- Doi string `config:"doi"` // The DOI, a digital identifier of an object, usually a dataset
95- Provider string `config:"provider"` // The DOI provider
105+ Doi string `config:"doi"` // The DOI, a digital identifier of an object, usually a dataset
106+ Provider string `config:"provider"` // The DOI provider
107+ ProxyURL string `config:"proxy_url"`
108+ ProxyCACert string `config:"proxy_ca_cert"`
96109}
97110
98111// Fs stores the interface to the remote HTTP files
@@ -277,9 +290,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
277290 }
278291 opt .Doi = parseDoi (opt .Doi )
279292
280- client , err := newHttpClient (ctx )
281- if err != nil {
282- return nil , err
293+ var client * http.Client
294+ if opt .ProxyURL != "" {
295+ client , err = newHttpClient (ctx , opt )
296+ if err != nil {
297+ return nil , err
298+ }
299+ } else {
300+ client = fshttp .NewClient (ctx )
283301 }
284302
285303 ci := fs .GetConfig (ctx )
0 commit comments