sometimes there is no port
This commit is contained in:
parent
cba61cb061
commit
1dfc89361b
|
|
@ -167,7 +167,7 @@ app.get("/", c => c.html(<Layout><Terminal /></Layout>))
|
||||||
app.get("/ws", c => {
|
app.get("/ws", c => {
|
||||||
const _sessionId = c.req.query("session")
|
const _sessionId = c.req.query("session")
|
||||||
const url = new URL(c.req.url)
|
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, {
|
return upgradeWebSocket(c, {
|
||||||
async onOpen(_e, ws) {
|
async onOpen(_e, ws) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user