Skip to content

Commit 40ab1f6

Browse files
committed
feat(dev): warn when the dev server is reachable from the network
1 parent 7e69f27 commit 40ab1f6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/nuxt-cli/src/dev/listen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ export async function createListener(bound: BoundServer, options: ListenOptions
334334
console.log(`${qr ? '' : '\n'}${lines.join('\n')}\n`)
335335
}
336336

337+
if (announce && (anyHost || !LOOPBACK_HOSTS.has(hostname))) {
338+
logger.warn('The dev server is reachable from the network without authentication: anyone who can connect can read the app, build errors and source code.')
339+
}
340+
337341
if (announce) {
338342
if (options.showURL !== false) {
339343
if (qrURL) {

0 commit comments

Comments
 (0)