Skip to content

Commit 9de9bc4

Browse files
authored
fix: proxy to secured websocket server (#10045)
1 parent 9f8d79b commit 9de9bc4

File tree

1 file changed

+3
-1
lines changed
  • packages/vite/src/node/server/middlewares

1 file changed

+3
-1
lines changed

packages/vite/src/node/server/middlewares/proxy.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export function proxyMiddleware(
8888
if (doesProxyContextMatchUrl(context, url)) {
8989
const [proxy, opts] = proxies[context]
9090
if (
91-
(opts.ws || opts.target?.toString().startsWith('ws:')) &&
91+
(opts.ws ||
92+
opts.target?.toString().startsWith('ws:') ||
93+
opts.target?.toString().startsWith('wss:')) &&
9294
req.headers['sec-websocket-protocol'] !== HMR_HEADER
9395
) {
9496
if (opts.rewrite) {

0 commit comments

Comments
 (0)