fresh
fresh copied to clipboard
Fresh V2 Beta WebSocket upgrade request never reaches server behind vite development environment
Hey there,
I've recently just migrated Fresh V2 from Alpha to Beta and now I'm noticing that WebSocket connections hangs and never arrives in a vite development environment. I've verified that the endpoint is most definitely reachable by sending a GET request, but however if the browser attempts a WebSocket connection, it seems to never even reach the server.
I'm guessing this has to do something with vite. No issues with production, building the project and starting has no issues with WebSocket connectivity.
//Client Connection: new WebSocket("ws://127.0.0.1:5174/somewebsocket")
//Server never sees WebSocket upgrade request.
app.get("/somewebsocket", (ctx) => {
const { socket, response } = Deno.upgradeWebSocket(ctx.req)
//More logic here.
return response
})
Thanks!