1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2025-09-19 12:06:01 +08:00

chore: add MinIdleSession option to AnyTLS configuration

This commit is contained in:
Larvan2
2025-02-21 13:30:24 +08:00
parent e2b75b35bb
commit 5830afcbde
4 changed files with 32 additions and 14 deletions

View File

@ -42,6 +42,7 @@ type AnyTLSOption struct {
UDP bool `proxy:"udp,omitempty"`
IdleSessionCheckInterval int `proxy:"idle-session-check-interval,omitempty"`
IdleSessionTimeout int `proxy:"idle-session-timeout,omitempty"`
MinIdleSession int `proxy:"min-idle-session,omitempty"`
}
func (t *AnyTLS) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error) {
@ -98,6 +99,7 @@ func NewAnyTLS(option AnyTLSOption) (*AnyTLS, error) {
Dialer: singDialer,
IdleSessionCheckInterval: time.Duration(option.IdleSessionCheckInterval) * time.Second,
IdleSessionTimeout: time.Duration(option.IdleSessionTimeout) * time.Second,
MinIdleSession: option.MinIdleSession,
}
tlsConfig := &vmess.TLSConfig{
Host: option.SNI,