mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-14 12:48:28 +10:00
Add hysteria and acme TLS certificate issuer (#18)
* Add hysteria client/server * Add acme TLS certificate issuer
This commit is contained in:
@@ -35,14 +35,6 @@ func startInstance(t *testing.T, options option.Options) {
|
||||
})
|
||||
}
|
||||
|
||||
func testTCP(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
|
||||
dialTCP := func() (net.Conn, error) {
|
||||
return dialer.DialContext(context.Background(), "tcp", M.ParseSocksaddrHostPort("127.0.0.1", testPort))
|
||||
}
|
||||
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
|
||||
}
|
||||
|
||||
func testSuit(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
|
||||
dialTCP := func() (net.Conn, error) {
|
||||
@@ -51,36 +43,34 @@ func testSuit(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialUDP := func() (net.PacketConn, error) {
|
||||
return dialer.ListenPacket(context.Background(), M.ParseSocksaddrHostPort("127.0.0.1", testPort))
|
||||
}
|
||||
/*t.Run("tcp", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var err error
|
||||
for retry := 0; retry < 3; retry++ {
|
||||
err = testLargeDataWithConn(t, testPort, dialTCP)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
require.NoError(t, err)
|
||||
})
|
||||
t.Run("udp", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var err error
|
||||
for retry := 0; retry < 3; retry++ {
|
||||
err = testLargeDataWithPacketConn(t, testPort, dialUDP)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
require.NoError(t, err)
|
||||
})*/
|
||||
//require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
|
||||
//require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
|
||||
// require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
|
||||
// require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
|
||||
require.NoError(t, testLargeDataWithConn(t, testPort, dialTCP))
|
||||
require.NoError(t, testLargeDataWithPacketConn(t, testPort, dialUDP))
|
||||
|
||||
// require.NoError(t, testPacketConnTimeout(t, dialUDP))
|
||||
}
|
||||
|
||||
func testTCP(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
|
||||
dialTCP := func() (net.Conn, error) {
|
||||
return dialer.DialContext(context.Background(), "tcp", M.ParseSocksaddrHostPort("127.0.0.1", testPort))
|
||||
}
|
||||
require.NoError(t, testLargeDataWithConn(t, testPort, dialTCP))
|
||||
}
|
||||
|
||||
func testSuitHy(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
|
||||
dialTCP := func() (net.Conn, error) {
|
||||
return dialer.DialContext(context.Background(), "tcp", M.ParseSocksaddrHostPort("127.0.0.1", testPort))
|
||||
}
|
||||
dialUDP := func() (net.PacketConn, error) {
|
||||
return dialer.ListenPacket(context.Background(), M.ParseSocksaddrHostPort("127.0.0.1", testPort))
|
||||
}
|
||||
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
|
||||
require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
|
||||
}
|
||||
|
||||
func testSuitWg(t *testing.T, clientPort uint16, testPort uint16) {
|
||||
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
|
||||
dialTCP := func() (net.Conn, error) {
|
||||
|
||||
Reference in New Issue
Block a user