Skip to content

Commit 0c3f817

Browse files
fix: use server port for websocket connection by default (#3185)
1 parent 1f0c3ac commit 0c3f817

File tree

6 files changed

+357
-278
lines changed

6 files changed

+357
-278
lines changed

lib/Server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ class Server {
758758
// eslint-disable-next-line no-shadow
759759
.then((port) => {
760760
this.port = port;
761+
761762
return this.server.listen(port, this.hostname, (error) => {
762763
if (this.options.hot || this.options.liveReload) {
763764
this.createSocketServer();

lib/utils/DevServerPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class DevServerPlugin {
4949

5050
/** @type {string} */
5151
const port =
52-
options.client && options.client.port
53-
? `&port=${options.client.port}`
52+
(options.client && options.client.port) || options.port
53+
? `&port=${options.client.port || options.port}`
5454
: '';
5555

5656
/** @type {string} */

0 commit comments

Comments
 (0)