mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-12 21:18:03 +08:00
chore: add some fields for override
This commit is contained in:
parent
23e3f12e88
commit
6399347a63
@ -28,14 +28,16 @@ type healthCheckSchema struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OverrideSchema struct {
|
type OverrideSchema struct {
|
||||||
UDP *bool `provider:"udp,omitempty"`
|
UDP *bool `provider:"udp,omitempty"`
|
||||||
Up *string `provider:"up,omitempty"`
|
Up *string `provider:"up,omitempty"`
|
||||||
Down *string `provider:"down,omitempty"`
|
Down *string `provider:"down,omitempty"`
|
||||||
DialerProxy *string `provider:"dialer-proxy,omitempty"`
|
DialerProxy *string `provider:"dialer-proxy,omitempty"`
|
||||||
SkipCertVerify *bool `provider:"skip-cert-verify,omitempty"`
|
SkipCertVerify *bool `provider:"skip-cert-verify,omitempty"`
|
||||||
Interface *string `provider:"interface-name,omitempty"`
|
Interface *string `provider:"interface-name,omitempty"`
|
||||||
RoutingMark *int `provider:"routing-mark,omitempty"`
|
RoutingMark *int `provider:"routing-mark,omitempty"`
|
||||||
IPVersion *string `provider:"ip-version,omitempty"`
|
IPVersion *string `provider:"ip-version,omitempty"`
|
||||||
|
AdditionalPrefix *string `provider:"additional-prefix,omitempty"`
|
||||||
|
AdditionalSuffix *string `provider:"additional-suffix,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type proxyProviderSchema struct {
|
type proxyProviderSchema struct {
|
||||||
|
@ -399,6 +399,14 @@ func proxiesParseAndFilter(filter string, excludeFilter string, excludeTypeArray
|
|||||||
if override.IPVersion != nil {
|
if override.IPVersion != nil {
|
||||||
mapping["ip-version"] = *override.IPVersion
|
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)
|
proxy, err := adapter.ParseProxy(mapping)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -862,6 +862,8 @@ proxy-providers:
|
|||||||
# interface-name: tailscale0
|
# interface-name: tailscale0
|
||||||
# routing-mark: 233
|
# routing-mark: 233
|
||||||
# ip-version: ipv4-prefer
|
# ip-version: ipv4-prefer
|
||||||
|
# additional-prefix: "[provider1]"
|
||||||
|
# additional-suffix: "test"
|
||||||
test:
|
test:
|
||||||
type: file
|
type: file
|
||||||
path: /test.yaml
|
path: /test.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user