Skip to content

Commit a16bbee

Browse files
authored
fix: use location.port as sock.port by default (#2850)
1 parent 1aa0d2d commit a16bbee

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

lib/utils/DevServerPlugin.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,8 @@ class DevServerPlugin {
2828
apply(compiler) {
2929
const { options } = this;
3030

31-
// we're stubbing the app in this method as it's static and doesn't require
32-
// a server to be supplied. createDomain requires an app with the
33-
// address() signature.
3431
/** @type {string} */
35-
const domain = createDomain(options, {
36-
address() {
37-
return { port: options.port };
38-
},
39-
});
32+
const domain = createDomain(options);
4033
/** @type {string} */
4134
const host =
4235
options.client && options.client.host

test/e2e/ClientOptions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('sockjs client proxy', () => {
7070
page.waitFor(beforeBrowserCloseDelay).then(() => {
7171
browser.close().then(() => {
7272
expect(requestObj.url()).toContain(
73-
`http://localhost:${port1}/ws`
73+
`http://localhost:${port2}/ws`
7474
);
7575
done();
7676
});

test/server/__snapshots__/Server.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Array [
66
"client",
77
"default",
88
"index.js?http:",
9-
"localhost:8100",
9+
"localhost",
1010
],
1111
Array [
1212
"node_modules",
@@ -26,7 +26,7 @@ Array [
2626
"client",
2727
"default",
2828
"index.js?http:",
29-
"localhost:8100",
29+
"localhost",
3030
],
3131
Array [
3232
"node_modules",

0 commit comments

Comments
 (0)