1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-10-12 12:04:13 -04:00
This commit is contained in:
Darien Raymond
2017-02-20 11:25:05 +01:00
parent bf7906c7f0
commit 29d614fda5
5 changed files with 14 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ type Destination struct {
Address Address
}
// DestinationFromAddr generates a Destination from a net address.
func DestinationFromAddr(addr net.Addr) Destination {
switch addr := addr.(type) {
case *net.TCPAddr:
@@ -52,6 +53,7 @@ func (v Destination) IsValid() bool {
return v.Network != Network_Unknown
}
// AsDestination converts current Enpoint into Destination.
func (v *Endpoint) AsDestination() Destination {
return Destination{
Network: v.Network,