Skip to content

Commit 939a1d7

Browse files
committed
Merge branch 'master' into universal-inline
1 parent 6bb5d5b commit 939a1d7

File tree

8 files changed

+381
-946
lines changed

8 files changed

+381
-946
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ client
99
coverage
1010
ssl/*.pem
1111
node_modules
12+
.vscode

client-src/default/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,14 @@ if (
221221
) {
222222
protocol = self.location.protocol;
223223
}
224-
225224
const socketUrl = url.format({
226225
protocol,
227226
auth: urlParts.auth,
228227
hostname,
229-
port,
228+
port:
229+
urlParts.path == null || urlParts.path === '/'
230+
? port
231+
: querystring.parse(urlParts.path).sockPort || port,
230232
// If sockPath is provided it'll be passed in via the __resourceQuery as a
231233
// query param so it has to be parsed out of the querystring in order for the
232234
// client to open the socket to the correct location.

lib/options.json

+13
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@
6767
"sockPath": {
6868
"type": "string"
6969
},
70+
"sockPort": {
71+
"anyOf": [
72+
{
73+
"type": "number"
74+
},
75+
{
76+
"type": "string"
77+
},
78+
{
79+
"type": "null"
80+
}
81+
]
82+
},
7083
"watchOptions": {
7184
"type": "object"
7285
},

lib/utils/addEntries.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ function addEntries(config, options, server) {
1717

1818
const domain = createDomain(options, app);
1919
const sockPath = options.sockPath ? `&sockPath=${options.sockPath}` : '';
20+
const sockPort = options.sockPort ? `&sockPort=${options.sockPort}` : '';
2021
const clientEntry = `${require.resolve(
2122
'../../client/'
22-
)}?${domain}${sockPath}`;
23+
)}?${domain}${sockPath}${sockPort}`;
2324
let hotEntry;
2425

2526
if (options.hotOnly) {

lib/utils/createConfig.js

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ function createConfig(config, argv, { port }) {
3030
options.socket = argv.socket;
3131
}
3232

33+
if (argv.sockPort) {
34+
options.sockPort = argv.sockPort;
35+
}
36+
3337
if (argv.progress) {
3438
options.progress = argv.progress;
3539
}

0 commit comments

Comments
 (0)