Skip to content

Commit f0498f6

Browse files
trashpanda001yyx990803
authored andcommitted
fix: use devServer.public to build sockjsUrl, if defined. (#1526)
1 parent e7e2fb2 commit f0498f6

File tree

1 file changed

+2
-1
lines changed
  • packages/@vue/cli-service/lib/commands

1 file changed

+2
-1
lines changed

packages/@vue/cli-service/lib/commands/serve.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ module.exports = (api, options) => {
8282

8383
// inject dev & hot-reload middleware entries
8484
if (!isProduction) {
85-
const sockjsUrl = url.format({
85+
const publicOpt = projectDevServerOptions.public
86+
const sockjsUrl = publicOpt ? `//${publicOpt}/sockjs-node` : url.format({
8687
protocol,
8788
port,
8889
hostname: urls.lanUrlForConfig || 'localhost',

0 commit comments

Comments
 (0)