@@ -44,14 +44,16 @@ type proxyProviderSchema struct {
44
44
Type string `provider:"type"`
45
45
Path string `provider:"path,omitempty"`
46
46
URL string `provider:"url,omitempty"`
47
+ Proxy string `provider:"proxy,omitempty"`
47
48
Interval int `provider:"interval,omitempty"`
48
49
Filter string `provider:"filter,omitempty"`
49
50
ExcludeFilter string `provider:"exclude-filter,omitempty"`
50
51
ExcludeType string `provider:"exclude-type,omitempty"`
51
52
DialerProxy string `provider:"dialer-proxy,omitempty"`
52
53
53
- HealthCheck healthCheckSchema `provider:"health-check,omitempty"`
54
- Override OverrideSchema `provider:"override,omitempty"`
54
+ HealthCheck healthCheckSchema `provider:"health-check,omitempty"`
55
+ Override OverrideSchema `provider:"override,omitempty"`
56
+ Header map [string ][]string `provider:"header,omitempty"`
55
57
}
56
58
57
59
func ParseProxyProvider (name string , mapping map [string ]any ) (types.ProxyProvider , error ) {
@@ -86,16 +88,14 @@ func ParseProxyProvider(name string, mapping map[string]any) (types.ProxyProvide
86
88
path := C .Path .Resolve (schema .Path )
87
89
vehicle = resource .NewFileVehicle (path )
88
90
case "http" :
91
+ path := C .Path .GetPathByHash ("proxies" , schema .URL )
89
92
if schema .Path != "" {
90
- path : = C .Path .Resolve (schema .Path )
93
+ path = C .Path .Resolve (schema .Path )
91
94
if ! features .CMFA && ! C .Path .IsSafePath (path ) {
92
95
return nil , fmt .Errorf ("%w: %s" , errSubPath , path )
93
96
}
94
- vehicle = resource .NewHTTPVehicle (schema .URL , path )
95
- } else {
96
- path := C .Path .GetPathByHash ("proxies" , schema .URL )
97
- vehicle = resource .NewHTTPVehicle (schema .URL , path )
98
97
}
98
+ vehicle = resource .NewHTTPVehicle (schema .URL , path , schema .Proxy , schema .Header )
99
99
default :
100
100
return nil , fmt .Errorf ("%w: %s" , errVehicleType , schema .Type )
101
101
}
0 commit comments