1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-03 07:45:29 -05:00

converting from host to address directly

This commit is contained in:
v2ray
2015-12-17 00:58:45 +01:00
parent 34a0cb0b70
commit 6543facd51
3 changed files with 12 additions and 10 deletions

View File

@@ -14,11 +14,7 @@ type DokodemoConfig struct {
}
func (this *DokodemoConfig) Address() v2net.Address {
if this.Host.IsIP() {
return v2net.IPAddress(this.Host.IP())
} else {
return v2net.DomainAddress(this.Host.Domain())
}
return this.Host.Address()
}
func (this *DokodemoConfig) Port() v2net.Port {

View File

@@ -37,11 +37,7 @@ func (t *ConfigTarget) UnmarshalJSON(data []byte) error {
log.Error("Address is not set in VMess outbound config.")
return proxyconfig.BadConfiguration
}
if rawConfig.Address.IsIP() {
t.Destination = v2net.TCPDestination(v2net.IPAddress(rawConfig.Address.IP()), rawConfig.Port)
} else {
t.Destination = v2net.TCPDestination(v2net.DomainAddress(rawConfig.Address.Domain()), rawConfig.Port)
}
t.Destination = v2net.TCPDestination(rawConfig.Address.Address(), rawConfig.Port)
return nil
}