chore: restful api contains provider-name for proxies

This commit is contained in:
wwqgtxx
2025-12-04 15:10:13 +08:00
parent 91f5593f4e
commit b5fa3ee99a
24 changed files with 48 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ func ParseProxy(mapping map[string]any, options ...ProxyOption) (C.Proxy, error)
opt := applyProxyOptions(options...)
basicOption := outbound.BasicOption{
DialerForAPI: opt.DialerForAPI,
ProviderName: opt.ProviderName,
}
var (
@@ -186,6 +187,7 @@ func ParseProxy(mapping map[string]any, options ...ProxyOption) (C.Proxy, error)
type proxyOption struct {
DialerForAPI C.Dialer
ProviderName string
}
func applyProxyOptions(options ...ProxyOption) proxyOption {
@@ -203,3 +205,9 @@ func WithDialerForAPI(dialer C.Dialer) ProxyOption {
opt.DialerForAPI = dialer
}
}
func WithProviderName(name string) ProxyOption {
return func(opt *proxyOption) {
opt.ProviderName = name
}
}