1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-17 13:05:24 +00:00

avoid port in-use error in websocket test

This commit is contained in:
Darien Raymond 2017-12-19 13:37:37 +01:00
parent 6c14ecb2a0
commit 054ceb865d
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -67,7 +67,7 @@ func TestDialWithRemoteAddr(t *testing.T) {
assert := With(t)
listen, err := ListenWS(internet.ContextWithTransportSettings(context.Background(), &Config{
Path: "ws",
}), net.DomainAddress("localhost"), 13146, func(ctx context.Context, conn internet.Connection) bool {
}), net.DomainAddress("localhost"), 13148, func(ctx context.Context, conn internet.Connection) bool {
go func(c internet.Connection) {
defer c.Close()
@ -89,7 +89,7 @@ func TestDialWithRemoteAddr(t *testing.T) {
assert(err, IsNil)
ctx := internet.ContextWithTransportSettings(context.Background(), &Config{Path: "ws", Header: []*Header{{Key: "X-Forwarded-For", Value: "1.1.1.1"}}})
conn, err := Dial(ctx, net.TCPDestination(net.DomainAddress("localhost"), 13146))
conn, err := Dial(ctx, net.TCPDestination(net.DomainAddress("localhost"), 13148))
assert(err, IsNil)
_, err = conn.Write([]byte("Test connection 1"))