Skip to content

Commit 251a52f

Browse files
authored
fix: never proxy hot-reload websocket requests
Both create-react-app and vue-cli-service have introduced workarounds for this, but it seems to me that this is always desirable behaviour for webpack-dev-server. vuejs/vue-cli@72ba750 facebook/create-react-app#7444
1 parent 537eeb2 commit 251a52f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Server.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,10 @@ class Server {
18411841
(this.server).on(
18421842
"upgrade",
18431843
/** @type {RequestHandler & { upgrade: NonNullable<RequestHandler["upgrade"]> }} */
1844-
(webSocketProxy).upgrade
1844+
(req, ...rest) =>
1845+
req.url !== this.options.webSocketServer.options.path
1846+
? webSocketProxy.upgrade(req, ...rest)
1847+
: null,
18451848
);
18461849
}, this);
18471850
}

0 commit comments

Comments
 (0)