1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00

test:listen

This commit is contained in:
Shelikhoo 2016-08-15 20:20:47 +08:00
parent 40ec84e222
commit 02e3c17c97
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -107,3 +107,18 @@ func Test_Connect_wss_guess_reuse(t *testing.T) {
i-- i--
} }
} }
func Test_listenWSAndDial(t *testing.T) {
assert := assert.On(t)
(&Config{Pto: "ws", Path: ""}).Apply()
listen, err := ListenWS(v2net.DomainAddress("localhost"), 13142)
assert.Error(err).IsNil()
go func() {
conn, err := listen.Accept()
assert.Error(err).IsNil()
conn.Close()
}()
conn, err := Dial(v2net.AnyIP, v2net.TCPDestination(v2net.DomainAddress("localhost"), 13142))
assert.Error(err).IsNil()
conn.Close()
}