1
0
Fork 0
mirror of https://github.com/SagerNet/sing-box.git synced 2025-04-06 13:27:37 +03:00

Fix create UDP DNS transport from plain IPv6 address

This commit is contained in:
世界 2023-01-08 16:26:31 +08:00
parent 044f9c5d4f
commit 23a35b3c06
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 26 additions and 26 deletions

View file

@ -175,11 +175,11 @@ func NewRouter(ctx context.Context, logFactory log.Factory, options option.Route
switch server.Address {
case "local", "rcode":
default:
serverURL, err := url.Parse(server.Address)
if err != nil {
return nil, err
serverURL, _ := url.Parse(server.Address)
var serverAddress string
if serverURL != nil {
serverAddress = serverURL.Hostname()
}
serverAddress := serverURL.Hostname()
if serverAddress == "" {
serverAddress = server.Address
}