From 29dcb433cfc889555c34553eed00c6ad7c1955a6 Mon Sep 17 00:00:00 2001 From: V2Ray Date: Tue, 15 Sep 2015 12:54:06 +0200 Subject: [PATCH] parse vnext address as ip --- net/vmess/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/vmess/config.go b/net/vmess/config.go index 479784a4..2db35529 100644 --- a/net/vmess/config.go +++ b/net/vmess/config.go @@ -2,6 +2,7 @@ package vmess import ( "encoding/json" + "net" "github.com/v2ray/v2ray-core" "github.com/v2ray/v2ray-core/log" @@ -43,8 +44,12 @@ func (config VNextConfig) ToVNextServer() VNextServer { } users = append(users, vuser) } + ip := net.ParseIP(config.Address) + if ip == nil { + panic(log.Error("Unable to parse VNext IP: %s", config.Address)) + } return VNextServer{ - v2net.DomainAddress(config.Address, config.Port), + v2net.IPAddress(ip, config.Port), users} }