diff --git a/app/Services/ServiceFnPoolV2rayTo.php b/app/Services/ServiceFnPoolV2rayTo.php index a7d8134c..c213cc92 100644 --- a/app/Services/ServiceFnPoolV2rayTo.php +++ b/app/Services/ServiceFnPoolV2rayTo.php @@ -149,7 +149,7 @@ class ServiceFnPoolV2rayTo } $aTransport = []; - if (isset($aCustom["type"]) && $aCustom["type"] != "none" && $aCustom["type"] != "tcp" && $aCustom["type"] != "raw") { + if (isset($aCustom["type"]) && $aCustom["type"] != "none" && $aCustom["type"] != "raw") { $aTransport["type"] = $aCustom["type"]; if ($aCustom["type"] == "ws" && isset($aTls["server_name"])) { $aTransport["headers"]["Host"] = $aTls["server_name"]; @@ -159,6 +159,9 @@ class ServiceFnPoolV2rayTo $aTransport["path"] = rawurldecode($aCustom["path"]); } if (!empty($aTransport)) { + if (empty($aTransport["type"])) { + $aTransport["type"] = "tcp"; + } $aNode["transport"] = $aTransport; } @@ -291,7 +294,7 @@ class ServiceFnPoolV2rayTo $aNode["alter_id"] = (int) $aNode["alter_id"]; $aTransport = []; - if (isset($aConfig["net"]) && $aConfig["net"] != "tcp" && $aConfig["net"] != "none" && $aConfig["net"] != "raw") { + if (isset($aConfig["net"]) && $aConfig["net"] != "none" && $aConfig["net"] != "raw") { $aTransport["type"] = $aConfig["net"]; } if (isset($aConfig["path"])) { @@ -301,6 +304,9 @@ class ServiceFnPoolV2rayTo $aTransport["headers"]["Host"] = $aConfig["host"]; } if (!empty($aTransport)) { + if (empty($aTransport["type"])) { + $aTransport["type"] = "tcp"; + } $aNode["transport"] = $aTransport; } @@ -362,7 +368,7 @@ class ServiceFnPoolV2rayTo $aTransport = []; - if (isset($aCustom["type"]) && $aCustom["type"] != "tcp" && $aCustom["type"] != "raw") { + if (isset($aCustom["type"]) && $aCustom["type"] != "raw") { $aTransport["type"] = $aCustom["type"]; } if (isset($aCustom["headerType"]) && $aCustom["headerType"] == "http") { @@ -378,6 +384,9 @@ class ServiceFnPoolV2rayTo $aTransport["service_name"] = $aCustom["serviceName"]; } if (!empty($aTransport)) { + if (empty($aTransport["type"])) { + $aTransport["type"] = "tcp"; + } $aNode["transport"] = $aTransport; }