This commit is contained in:
yuhan6665 2025-06-23 23:13:48 +08:00 committed by GitHub
commit 1b69b57fb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1454 additions and 182 deletions

View file

@ -30,6 +30,18 @@ import (
)
func TestVless(t *testing.T) {
testVlessSeed(t, "")
}
func TestVlessSeedWithFixedTrigger(t *testing.T) {
testVlessSeed(t, "1")
}
func TestVlessSeedWithPingPong(t *testing.T) {
testVlessSeed(t, "pingpong")
}
func testVlessSeed(t *testing.T, seed string) {
tcpServer := tcp.Server{
MsgProcessor: xor,
}
@ -57,6 +69,7 @@ func TestVless(t *testing.T) {
{
Account: serial.ToTypedMessage(&vless.Account{
Id: userID.String(),
Seed: seed,
}),
},
},
@ -102,6 +115,7 @@ func TestVless(t *testing.T) {
{
Account: serial.ToTypedMessage(&vless.Account{
Id: userID.String(),
Seed: seed,
}),
},
},
@ -248,6 +262,18 @@ func TestVlessTls(t *testing.T) {
}
func TestVlessXtlsVision(t *testing.T) {
testVlessXtlsVisionWithSeed(t, "")
}
func TestVlessXtlsVisionWithFixedTrigger(t *testing.T) {
testVlessXtlsVisionWithSeed(t, "1")
}
func TestVlessXtlsVisionWithPingPong(t *testing.T) {
testVlessXtlsVisionWithSeed(t, "pingpong")
}
func testVlessXtlsVisionWithSeed(t *testing.T, seed string) {
tcpServer := tcp.Server{
MsgProcessor: xor,
}
@ -285,6 +311,7 @@ func TestVlessXtlsVision(t *testing.T) {
Account: serial.ToTypedMessage(&vless.Account{
Id: userID.String(),
Flow: vless.XRV,
Seed: seed,
}),
},
},
@ -331,6 +358,7 @@ func TestVlessXtlsVision(t *testing.T) {
Account: serial.ToTypedMessage(&vless.Account{
Id: userID.String(),
Flow: vless.XRV,
Seed: seed,
}),
},
},
@ -343,7 +371,7 @@ func TestVlessXtlsVision(t *testing.T) {
TransportSettings: []*internet.TransportConfig{
{
ProtocolName: "tcp",
Settings: serial.ToTypedMessage(&transtcp.Config{}),
Settings: serial.ToTypedMessage(&transtcp.Config{}),
},
},
SecurityType: serial.GetMessageType(&tls.Config{}),