mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-04 12:27:36 +03:00
Add ss aead tests
This commit is contained in:
parent
2c2eb31e18
commit
5a3de62c50
6 changed files with 27 additions and 8 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/sagernet/sing-box"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
"github.com/sagernet/sing/common/control"
|
||||
F "github.com/sagernet/sing/common/format"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
"github.com/sagernet/sing/protocol/socks"
|
||||
|
@ -20,11 +21,11 @@ func mkPort(t *testing.T) uint16 {
|
|||
var lc net.ListenConfig
|
||||
lc.Control = control.ReuseAddr()
|
||||
for {
|
||||
tcpListener, err := net.ListenTCP("tcp", nil)
|
||||
tcpListener, err := lc.Listen(context.Background(), "tcp", ":0")
|
||||
require.NoError(t, err)
|
||||
listenPort := M.SocksaddrFromNet(tcpListener.Addr()).Port
|
||||
tcpListener.Close()
|
||||
udpListener, err := net.ListenUDP("udp", &net.UDPAddr{Port: int(listenPort)})
|
||||
udpListener, err := lc.Listen(context.Background(), "tcp", F.ToString(":", listenPort))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue