mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
Add MTProxy, MASQUE, VPN, Link parser. Update AmneziaWG. Remove Tunneling
This commit is contained in:
30
parser/clash/anytls.go
Normal file
30
parser/clash/anytls.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package clash
|
||||
|
||||
import (
|
||||
"github.com/sagernet/sing-box/option"
|
||||
"github.com/sagernet/sing/common/json/badoption"
|
||||
)
|
||||
|
||||
type AnyTLSOption struct {
|
||||
DialerOptions `yaml:",inline"`
|
||||
ServerOptions `yaml:",inline"`
|
||||
TLSOptions `yaml:",inline"`
|
||||
Password string `yaml:"password"`
|
||||
UDP bool `yaml:"udp,omitempty"`
|
||||
IdleSessionCheckInterval int `yaml:"idle-session-check-interval,omitempty"`
|
||||
IdleSessionTimeout int `yaml:"idle-session-timeout,omitempty"`
|
||||
MinIdleSession int `yaml:"min-idle-session,omitempty"`
|
||||
}
|
||||
|
||||
func (a *AnyTLSOption) Build() any {
|
||||
a.TLS = true
|
||||
return &option.AnyTLSOutboundOptions{
|
||||
DialerOptions: a.DialerOptions.Build(),
|
||||
ServerOptions: a.ServerOptions.Build(),
|
||||
OutboundTLSOptionsContainer: clashTLSOptions(a.Server, &a.TLSOptions),
|
||||
Password: a.Password,
|
||||
IdleSessionCheckInterval: badoption.Duration(a.IdleSessionCheckInterval),
|
||||
IdleSessionTimeout: badoption.Duration(a.IdleSessionTimeout),
|
||||
MinIdleSession: a.MinIdleSession,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user