Skip to content

Commit

Permalink
fix: never proxy hot-reload websocket requests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ajhyndman authored Feb 27, 2022
1 parent 537eeb2 commit 251a52f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,10 @@ class Server {
(this.server).on(
"upgrade",
/** @type {RequestHandler & { upgrade: NonNullable<RequestHandler["upgrade"]> }} */
(webSocketProxy).upgrade
(req, ...rest) =>
req.url !== this.options.webSocketServer.options.path
? webSocketProxy.upgrade(req, ...rest)
: null,
);
}, this);
}
Expand Down

0 comments on commit 251a52f

Please sign in to comment.