walkor 1 年之前
父節點
當前提交
7cbeb8036e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Protocols/Ws.php

+ 1 - 1
src/Protocols/Ws.php

@@ -361,7 +361,7 @@ class Ws
         }
         // Get Host.
         $port = $connection->getRemotePort();
-        $host = $port === 80 ? $connection->getRemoteHost() : $connection->getRemoteHost() . ':' . $port;
+        $host = $port === 80 || $port === 443 ? $connection->getRemoteHost() : $connection->getRemoteHost() . ':' . $port;
         // Handshake header.
         $connection->context->websocketSecKey = base64_encode(random_bytes(16));
         $userHeader = $connection->headers ?? null;