1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-27 22:39:09 -04:00

protobuf for net

This commit is contained in:
Darien Raymond
2016-08-27 00:04:35 +02:00
parent 64e38ba851
commit cdb4c56546
20 changed files with 323 additions and 77 deletions

View File

@@ -186,3 +186,13 @@ func (this *domainAddress) Equals(another Address) bool {
}
return this.Domain() == anotherDomain.Domain()
}
func (this *AddressPB) AsAddress() Address {
switch addr := this.Address.(type) {
case *AddressPB_Ip:
return IPAddress(addr.Ip)
case *AddressPB_Domain:
return DomainAddress(addr.Domain)
}
panic("Common|Net: Invalid AddressPB.")
}