Skip to content

Commit

Permalink
fix: proxy to secured websocket server (#10045)
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored Sep 9, 2022
1 parent 9f8d79b commit 9de9bc4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/server/middlewares/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export function proxyMiddleware(
if (doesProxyContextMatchUrl(context, url)) {
const [proxy, opts] = proxies[context]
if (
(opts.ws || opts.target?.toString().startsWith('ws:')) &&
(opts.ws ||
opts.target?.toString().startsWith('ws:') ||
opts.target?.toString().startsWith('wss:')) &&
req.headers['sec-websocket-protocol'] !== HMR_HEADER
) {
if (opts.rewrite) {
Expand Down

0 comments on commit 9de9bc4

Please sign in to comment.