Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ablility to disable forced refresh when Vite loses server connection #8861

Closed
4 tasks done
moorbren opened this issue Jun 30, 2022 · 2 comments · Fixed by #9007
Closed
4 tasks done

Ablility to disable forced refresh when Vite loses server connection #8861

moorbren opened this issue Jun 30, 2022 · 2 comments · Fixed by #9007

Comments

@moorbren
Copy link

moorbren commented Jun 30, 2022

Description

I need to route my development server through two proxies in order to test my application on Confluence / Jira Cloud, and the websocket connection gets lost along the way. After 4+ hours of research and I decent amount of networking experience I can't figure out how to get the websocket to work.

My only workaround is editing the source code in order to prevent the constant refresh (thanks #592), which doesn't really scale well to multiple users / setups.

The error message of my pain in question:
[vite] server connection lost. polling for restart...

Suggested solution

A feature to prevent the refresh as simple as a boolean value would be nice, ideally under the server config (don't really care where).

Something like:

server: {
   disableDisconnectRefresh: true,
}

Alternative

If anyone knows anything about routing a websocket through 3 target ports, I'd be open to working things out that way as well.

Here's my current setup:
Vite Server (servePort:3001, hmrPort:3001 ) -> Express backend proxying port 3001 on port 3000 -> Ngrok tunnel on port 443 (which is where the websocket gets lost)

Additional context

Lmk if this is something you guys are interested in and I can submit a merge or something. Looks like you closed a dupe of this issue (#592) a couple years ago and I don't want to spend time on something no one but me wants.

Thanks!

Validations

@sapphi-red
Copy link
Member

Vite 3.0.0-beta.5 includes #8650 which improves port inference.
Would you test it?
If express backend supports proxying websocket, it should work with the config below.

{
  server: {
    port: 3001,
    strictPort: true
  }
}

@tmikaeld
Copy link

tmikaeld commented Jul 6, 2022

We're running a Deno proxy that cannot forward websocket connections (no one can figure out how), so Vite keeps refreshing every time websockets time-out, would be great if we could manually reload.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants