-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Describe the bug
The documentation for server.hmr configuration specifies the following options: boolean | { protocol?: string, host?: string, port?: number, path?: string, timeout?: number, overlay?: boolean } It appears to lack the server?: Server option.
Is this option internal to Vite, or is it intended to be used as explained below? If intended for public use, perhaps the documentation could explain its usage.
In vite/src/node/server/ws.ts, there is a reference to the hmr.server option. When Vite runs in middlewareMode, the server object can be passed via this option (in this case, SvelteKit). This allows a secure web socket connection,which uses https:// for certificate validation, to 'piggyback' onto the specified server.
This option is useful for of self-signed certificates -- The acceptance of the certificate will allow both https// and wss:// connections to proceed.
Reproduction
No repo. Documentation only.
System Info
System:
OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
Memory: 24.35 GB / 31.04 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.17.0 - /usr/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.12.0 - /usr/local/bin/npm
Browsers:
Brave Browser: 90.1.24.85
Chrome: 90.0.4430.212
Firefox: 88.0.1Used package manager: Not applicable
Logs
Not Applicable
Before submitting the issue, please make sure you do the following
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Provide a description in this issue that describes the bug.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.