From ee562070f2a46d8f71eac117333e950737e04bf1 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 1 Mar 2024 04:12:07 -0800 Subject: [PATCH] docs(hmr): document `hmr.protocol` setting (#16056) --- docs/config/server-options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/config/server-options.md b/docs/config/server-options.md index 5b1480ac6cfde2..8ae5f5cb5f3624 100644 --- a/docs/config/server-options.md +++ b/docs/config/server-options.md @@ -152,6 +152,8 @@ Disable or configure HMR connection (in cases where the HMR websocket must use a Set `server.hmr.overlay` to `false` to disable the server error overlay. +`protocol` sets the WebSocket protocol used for the HMR connection: `ws` (WebSocket) or `wss` (WebSocket Secure). + `clientPort` is an advanced option that overrides the port only on the client side, allowing you to serve the websocket on a different port than the client code looks for it on. When `server.hmr.server` is defined, Vite will process the HMR connection requests through the provided server. If not in middleware mode, Vite will attempt to process HMR connection requests through the existing server. This can be helpful when using self-signed certificates or when you want to expose Vite over a network on a single port.