Browse Source

fix dns port string to int

Tokumeikoi 5 years ago
parent
commit
54a8542e0f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Services/ServerService.php

+ 6 - 0
app/Services/ServerService.php

@@ -59,6 +59,12 @@ class ServerService
                 array_push($dns->servers, '1.1.1.1');
                 array_push($dns->servers, 'localhost');
             }
+            $dns->servers = array_map(function ($v) {
+               if (is_object($v)) {
+                   $v->port = (int)$v->port;
+               }
+               return $v;
+            }, $dns->servers);
             $json->dns = $dns;
             $json->outbound->settings->domainStrategy = 'UseIP';
         }