From 4e88a369c41e905069087a0154f9d7a78dac6136 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Tue, 14 Dec 2021 19:47:23 -0500 Subject: [PATCH] Fix vmess test with portList --- proxy/vmess/encoding/client.go | 3 +-- proxy/vmess/encoding/server.go | 3 +-- testing/scenarios/vmess_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/proxy/vmess/encoding/client.go b/proxy/vmess/encoding/client.go index c4309676..3d573210 100644 --- a/proxy/vmess/encoding/client.go +++ b/proxy/vmess/encoding/client.go @@ -13,8 +13,6 @@ import ( "hash/fnv" "io" - "github.com/xtls/xray-core/common/drain" - "golang.org/x/crypto/chacha20poly1305" "github.com/xtls/xray-core/common" @@ -22,6 +20,7 @@ import ( "github.com/xtls/xray-core/common/buf" "github.com/xtls/xray-core/common/crypto" "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/drain" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/proxy/vmess" diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index d49b72ff..fb2620d6 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -12,14 +12,13 @@ import ( "sync" "time" - "github.com/xtls/xray-core/common/drain" - "golang.org/x/crypto/chacha20poly1305" "github.com/xtls/xray-core/common" "github.com/xtls/xray-core/common/bitmask" "github.com/xtls/xray-core/common/buf" "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/drain" "github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/task" diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index 5da53a7a..79bff40a 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -1436,8 +1436,8 @@ func TestVMessGCMLengthAuthPlusNoTerminationSignal(t *testing.T) { Inbound: []*core.InboundHandlerConfig{ { ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{ - PortRange: net.SinglePortRange(serverPort), - Listen: net.NewIPOrDomain(net.LocalHostIP), + PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}}, + Listen: net.NewIPOrDomain(net.LocalHostIP), }), ProxySettings: serial.ToTypedMessage(&inbound.Config{ User: []*protocol.User{ @@ -1470,8 +1470,8 @@ func TestVMessGCMLengthAuthPlusNoTerminationSignal(t *testing.T) { Inbound: []*core.InboundHandlerConfig{ { ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{ - PortRange: net.SinglePortRange(clientPort), - Listen: net.NewIPOrDomain(net.LocalHostIP), + PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(clientPort)}}, + Listen: net.NewIPOrDomain(net.LocalHostIP), }), ProxySettings: serial.ToTypedMessage(&dokodemo.Config{ Address: net.NewIPOrDomain(dest.Address),