1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-18 18:36:11 -05:00

Support Listen WebSocket Connection

This commit is contained in:
Shelikhoo 2016-08-13 21:43:46 +08:00
parent 29f69d63c4
commit 7ef66c57dc
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -17,6 +17,7 @@ var (
KCPListenFunc ListenFunc KCPListenFunc ListenFunc
TCPListenFunc ListenFunc TCPListenFunc ListenFunc
RawTCPListenFunc ListenFunc RawTCPListenFunc ListenFunc
WSListenFunc ListenFunc
) )
type ListenFunc func(address v2net.Address, port v2net.Port) (Listener, error) type ListenFunc func(address v2net.Address, port v2net.Port) (Listener, error)
@ -42,6 +43,8 @@ func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandle
listener, err = TCPListenFunc(address, port) listener, err = TCPListenFunc(address, port)
case settings.IsCapableOf(StreamConnectionTypeKCP): case settings.IsCapableOf(StreamConnectionTypeKCP):
listener, err = KCPListenFunc(address, port) listener, err = KCPListenFunc(address, port)
case settings.IsCapableOf(StreamConnectionTypeWebSocket):
listener, err = WSListenFunc(address, port)
case settings.IsCapableOf(StreamConnectionTypeRawTCP): case settings.IsCapableOf(StreamConnectionTypeRawTCP):
listener, err = RawTCPListenFunc(address, port) listener, err = RawTCPListenFunc(address, port)
default: default: