From 1dfc89361bbd9dfea9d7125e7943d7077d8ee655 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:48:03 -0700 Subject: [PATCH] sometimes there is no port --- src/server.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.tsx b/src/server.tsx index f2780e0..ba4fbec 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -167,7 +167,7 @@ app.get("/", c => c.html()) app.get("/ws", c => { const _sessionId = c.req.query("session") const url = new URL(c.req.url) - let hostname = url.hostname + (url.port === "80" ? "" : `:${url.port}`) + let hostname = url.hostname + (!url.port || url.port === "80" ? "" : `:${url.port}`) return upgradeWebSocket(c, { async onOpen(_e, ws) {