Add v2ray QUIC transport

This commit is contained in:
世界
2022-08-22 21:20:05 +08:00
parent 77c98fd042
commit d4b7e221f0
22 changed files with 336 additions and 25 deletions

View File

@@ -59,7 +59,7 @@ func testTCP(t *testing.T, clientPort uint16, testPort uint16) {
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
}
func testSuitHy(t *testing.T, clientPort uint16, testPort uint16) {
func testSuitQUIC(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))

View File

@@ -83,7 +83,7 @@ func TestHysteriaSelf(t *testing.T) {
},
},
})
testSuitHy(t, clientPort, testPort)
testSuitQUIC(t, clientPort, testPort)
}
func TestHysteriaInbound(t *testing.T) {
@@ -180,5 +180,5 @@ func TestHysteriaOutbound(t *testing.T) {
},
},
})
testSuitHy(t, clientPort, testPort)
testSuitQUIC(t, clientPort, testPort)
}

View File

@@ -59,8 +59,7 @@ func TestTrojanSelf(t *testing.T) {
_, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
startInstance(t, option.Options{
Log: &option.LogOptions{
Level: "error",
Output: "stderr",
Level: "error",
},
Inbounds: []option.Inbound{
{

View File

@@ -229,8 +229,7 @@ func testVMessOutboundWithV2Ray(t *testing.T, security string, uuid uuid.UUID, g
func testVMessSelf(t *testing.T, security string, uuid uuid.UUID, alterId int, globalPadding bool, authenticatedLength bool) {
startInstance(t, option.Options{
Log: &option.LogOptions{
Level: "error",
Output: "stderr",
Level: "error",
},
Inbounds: []option.Inbound{
{

View File

@@ -45,14 +45,19 @@ func TestVMessWebscoketSelf(t *testing.T) {
})
}
func TestVMessQUICSelf(t *testing.T) {
testVMessWebscoketSelf(t, &option.V2RayTransportOptions{
Type: C.V2RayTransportTypeQUIC,
})
}
func testVMessWebscoketSelf(t *testing.T, transport *option.V2RayTransportOptions) {
user, err := uuid.DefaultGenerator.NewV4()
require.NoError(t, err)
_, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
startInstance(t, option.Options{
Log: &option.LogOptions{
Level: "error",
Output: "stderr",
Level: "error",
},
Inbounds: []option.Inbound{
{
@@ -122,5 +127,5 @@ func testVMessWebscoketSelf(t *testing.T, transport *option.V2RayTransportOption
},
},
})
testSuit(t, clientPort, testPort)
testSuitQUIC(t, clientPort, testPort)
}