Skip to content

Commit dd10a21

Browse files
committed
fix
1 parent faa2bfe commit dd10a21

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

protocol/group/balancer/roundrobin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func NewRoundRobin(outbounds []adapter.Outbound, options option.BalancerOutbound
2727
}
2828

2929
func (s *RoundRobin) Now() string {
30-
s.idxMutex.Lock()
31-
defer s.idxMutex.Unlock()
30+
// s.idxMutex.Lock()
31+
// defer s.idxMutex.Unlock()
3232
return ""
3333
}
3434

transport/v2ray/transport.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/sagernet/sing-box/common/tls"
88
C "github.com/sagernet/sing-box/constant"
99
"github.com/sagernet/sing-box/option"
10+
"github.com/sagernet/sing-box/transport/v2raydnstt"
1011
"github.com/sagernet/sing-box/transport/v2rayhttp"
1112
"github.com/sagernet/sing-box/transport/v2rayhttpupgrade"
1213
"github.com/sagernet/sing-box/transport/v2raywebsocket"
@@ -52,6 +53,8 @@ func NewClientTransport(ctx context.Context, dialer N.Dialer, serverAddr M.Socks
5253
return nil, nil
5354
}
5455
switch options.Type {
56+
case C.V2RayTransportTypeDNSTT:
57+
return v2raydnstt.NewClient(ctx, dialer, serverAddr, options.DNSTTOptions, tlsConfig)
5558
case C.V2RayTransportTypeHTTP:
5659
return v2rayhttp.NewClient(ctx, dialer, serverAddr, options.HTTPOptions, tlsConfig)
5760
case C.V2RayTransportTypeGRPC:

transport/v2raydnstt/dnstt.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ type Client struct {
3232

3333
// Close implements [adapter.V2RayClientTransport].
3434
func (c *Client) Close() error {
35-
35+
if c.tunnel != nil {
36+
c.tunnel.Close()
37+
}
38+
return nil
3639
}
3740

3841
func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, options option.DnsttOptions, tlsConfig tls.Config) (adapter.V2RayClientTransport, error) {

0 commit comments

Comments
 (0)