test:listen

pull/238/head
Shelikhoo 8 years ago
parent 40ec84e222
commit 02e3c17c97
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

@ -107,3 +107,18 @@ func Test_Connect_wss_guess_reuse(t *testing.T) {
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()
}

Loading…
Cancel
Save