mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
test:listen
This commit is contained in:
parent
40ec84e222
commit
02e3c17c97
@ -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…
Reference in New Issue
Block a user