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:
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user