1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-16 17:38:45 -05:00

Func: ListenTCP6

This commit is contained in:
Shelikhoo 2016-06-12 12:37:56 +08:00
parent 2fd963801c
commit e51710d144
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -8,6 +8,8 @@ import (
"github.com/v2ray/v2ray-core/common/log" "github.com/v2ray/v2ray-core/common/log"
v2net "github.com/v2ray/v2ray-core/common/net" v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/proxy"
"github.com/v2ray/v2ray-core/transport"
) )
var ( var (
@ -47,6 +49,14 @@ func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandle
go hub.start() go hub.start()
return hub, nil return hub, nil
} }
func ListenTCP6(address v2net.Address, port v2net.Port, callback ConnectionHandler, proxyMeta proxy.InboundHandlerMeta, tlsConfig *tls.Config) (*TCPHub, error) {
if proxyMeta.KcpSupported && transport.IsKcpEnabled() {
return nil, errors.New("ListenTCP6: Not Implemented")
} else {
return ListenTCP(address, port, callback, tlsConfig)
}
return nil, errors.New("ListenTCP6: Not Implemented")
}
func (this *TCPHub) Close() { func (this *TCPHub) Close() {
this.accepting = false this.accepting = false