mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-05 06:03:34 +03:00
chore: add some fields for override
This commit is contained in:
parent
23e3f12e88
commit
6399347a63
3 changed files with 20 additions and 8 deletions
|
@ -28,14 +28,16 @@ type healthCheckSchema struct {
|
|||
}
|
||||
|
||||
type OverrideSchema struct {
|
||||
UDP *bool `provider:"udp,omitempty"`
|
||||
Up *string `provider:"up,omitempty"`
|
||||
Down *string `provider:"down,omitempty"`
|
||||
DialerProxy *string `provider:"dialer-proxy,omitempty"`
|
||||
SkipCertVerify *bool `provider:"skip-cert-verify,omitempty"`
|
||||
Interface *string `provider:"interface-name,omitempty"`
|
||||
RoutingMark *int `provider:"routing-mark,omitempty"`
|
||||
IPVersion *string `provider:"ip-version,omitempty"`
|
||||
UDP *bool `provider:"udp,omitempty"`
|
||||
Up *string `provider:"up,omitempty"`
|
||||
Down *string `provider:"down,omitempty"`
|
||||
DialerProxy *string `provider:"dialer-proxy,omitempty"`
|
||||
SkipCertVerify *bool `provider:"skip-cert-verify,omitempty"`
|
||||
Interface *string `provider:"interface-name,omitempty"`
|
||||
RoutingMark *int `provider:"routing-mark,omitempty"`
|
||||
IPVersion *string `provider:"ip-version,omitempty"`
|
||||
AdditionalPrefix *string `provider:"additional-prefix,omitempty"`
|
||||
AdditionalSuffix *string `provider:"additional-suffix,omitempty"`
|
||||
}
|
||||
|
||||
type proxyProviderSchema struct {
|
||||
|
|
|
@ -399,6 +399,14 @@ func proxiesParseAndFilter(filter string, excludeFilter string, excludeTypeArray
|
|||
if override.IPVersion != nil {
|
||||
mapping["ip-version"] = *override.IPVersion
|
||||
}
|
||||
if override.AdditionalPrefix != nil {
|
||||
name := mapping["name"].(string)
|
||||
mapping["name"] = *override.AdditionalPrefix + name
|
||||
}
|
||||
if override.AdditionalSuffix != nil {
|
||||
name := mapping["name"].(string)
|
||||
mapping["name"] = name + *override.AdditionalSuffix
|
||||
}
|
||||
|
||||
proxy, err := adapter.ParseProxy(mapping)
|
||||
if err != nil {
|
||||
|
|
|
@ -862,6 +862,8 @@ proxy-providers:
|
|||
# interface-name: tailscale0
|
||||
# routing-mark: 233
|
||||
# ip-version: ipv4-prefer
|
||||
# additional-prefix: "[provider1]"
|
||||
# additional-suffix: "test"
|
||||
test:
|
||||
type: file
|
||||
path: /test.yaml
|
||||
|
|
Loading…
Add table
Reference in a new issue