1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-04 08:15:21 -05:00

registerable dialer and listener

This commit is contained in:
Darien Raymond
2017-01-03 15:16:48 +01:00
parent 31d6e74482
commit 21a15bbf74
10 changed files with 63 additions and 60 deletions

View File

@@ -4,6 +4,7 @@ import (
"crypto/tls"
"net"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/log"
v2net "v2ray.com/core/common/net"
@@ -34,7 +35,7 @@ func Dial(src v2net.Address, dest v2net.Destination, options internet.DialerOpti
}
if conn == nil {
var err error
conn, err = internet.DialToDest(src, dest)
conn, err = internet.DialSystem(src, dest)
if err != nil {
return nil, err
}
@@ -69,5 +70,5 @@ func Dial(src v2net.Address, dest v2net.Destination, options internet.DialerOpti
}
func init() {
internet.TCPDialer = Dial
common.Must(internet.RegisterNetworkDialer(v2net.Network_TCP, Dial))
}