Skip to content

Commit

Permalink
fix: use server port for websocket connection by default (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 29, 2021
1 parent 1f0c3ac commit 0c3f817
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 278 deletions.
1 change: 1 addition & 0 deletions lib/Server.js
Expand Up @@ -758,6 +758,7 @@ class Server {
// eslint-disable-next-line no-shadow
.then((port) => {
this.port = port;

return this.server.listen(port, this.hostname, (error) => {
if (this.options.hot || this.options.liveReload) {
this.createSocketServer();
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/DevServerPlugin.js
Expand Up @@ -49,8 +49,8 @@ class DevServerPlugin {

/** @type {string} */
const port =
options.client && options.client.port
? `&port=${options.client.port}`
(options.client && options.client.port) || options.port
? `&port=${options.client.port || options.port}`
: '';

/** @type {string} */
Expand Down

0 comments on commit 0c3f817

Please sign in to comment.