Implementation read waiter for socks5 UDP and UoT

This commit is contained in:
世界 2023-12-06 20:16:37 +08:00
parent ae8098ad39
commit aa34723225
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 97 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import (
"os"
"strings"
"github.com/sagernet/sing/common/bufio"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
@ -147,7 +148,7 @@ func (c *Client) DialContext(ctx context.Context, network string, address M.Sock
tcpConn.Close()
return nil, err
}
return NewAssociateConn(udpConn, address, tcpConn), nil
return NewAssociatePacketConn(bufio.NewUnbindPacketConn(udpConn), address, tcpConn), nil
}
return nil, os.ErrInvalid
}