Chore: adjust vmess 0rtt code and split xray test
This commit is contained in:
@ -348,13 +348,13 @@ func TestClash_VmessGrpc(t *testing.T) {
|
||||
|
||||
func TestClash_VmessWebsocket0RTT(t *testing.T) {
|
||||
cfg := &container.Config{
|
||||
Image: ImageXray,
|
||||
Image: ImageVmess,
|
||||
ExposedPorts: defaultExposedPorts,
|
||||
}
|
||||
hostCfg := &container.HostConfig{
|
||||
PortBindings: defaultPortBindings,
|
||||
Binds: []string{
|
||||
fmt.Sprintf("%s:/etc/xray/config.json", C.Path.Resolve("vmess-ws-0rtt.json")),
|
||||
fmt.Sprintf("%s:/etc/v2ray/config.json", C.Path.Resolve("vmess-ws-0rtt.json")),
|
||||
},
|
||||
}
|
||||
|
||||
@ -387,6 +387,46 @@ func TestClash_VmessWebsocket0RTT(t *testing.T) {
|
||||
testSuit(t, proxy)
|
||||
}
|
||||
|
||||
func TestClash_VmessWebsocketXray0RTT(t *testing.T) {
|
||||
cfg := &container.Config{
|
||||
Image: ImageXray,
|
||||
ExposedPorts: defaultExposedPorts,
|
||||
}
|
||||
hostCfg := &container.HostConfig{
|
||||
PortBindings: defaultPortBindings,
|
||||
Binds: []string{
|
||||
fmt.Sprintf("%s:/etc/xray/config.json", C.Path.Resolve("vmess-ws-0rtt.json")),
|
||||
},
|
||||
}
|
||||
|
||||
id, err := startContainer(cfg, hostCfg, "vmess-xray-ws-0rtt")
|
||||
if err != nil {
|
||||
assert.FailNow(t, err.Error())
|
||||
}
|
||||
defer cleanContainer(id)
|
||||
|
||||
proxy, err := outbound.NewVmess(outbound.VmessOption{
|
||||
Name: "vmess",
|
||||
Server: localIP.String(),
|
||||
Port: 10002,
|
||||
UUID: "b831381d-6324-4d53-ad4f-8cda48b30811",
|
||||
Cipher: "auto",
|
||||
AlterID: 32,
|
||||
Network: "ws",
|
||||
UDP: true,
|
||||
ServerName: "example.org",
|
||||
WSOpts: outbound.WSOptions{
|
||||
Path: "/?ed=2048",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
assert.FailNow(t, err.Error())
|
||||
}
|
||||
|
||||
time.Sleep(waitTime)
|
||||
testSuit(t, proxy)
|
||||
}
|
||||
|
||||
func Benchmark_Vmess(b *testing.B) {
|
||||
configPath := C.Path.Resolve("vmess-aead.json")
|
||||
|
||||
|
Reference in New Issue
Block a user