feat: print resolved address for localhost#8647
Merged
patak-cat merged 9 commits intovitejs:mainfrom Jun 20, 2022
Merged
Conversation
Member
Author
|
|
11 tasks
bluwy
reviewed
Jun 18, 2022
bluwy
reviewed
Jun 19, 2022
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
bluwy
approved these changes
Jun 20, 2022
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE:
server.printUrls/previewServer.printUrlsare now async.Description
#8543 used
verbatim: trueto makelocalhostresolved by DNS.But it was removed by #8642 for compatibility reasons with node ecosystem.
This PR changes the hostname printed when server starts.
The resolved address is used when the node.js resolver differs from DNS.
The printed url differs from the config so it looks a bit weird.
But this can be avoided by calling
dns.setDefaultResultOrder('verbatim')invite.config.js.This will fix the hijacking issue which #8543 tried to solve.
Why does this solve them?
before
Vite:
127.0.0.1:3000Other server:
[::]:3000Log output:
localhost:3000=>[::1]:3000Mismatch#8543
Vite:
localhost:3000=>[::1]:3000Other server:
[::]:3000Log output:
localhost:3000=>[::1]:3000This PR
Vite:
localhost:3000=>[::1]:3000Other server:
[::]:3000Log output:
[::1]:3000(if DNS resolves to[::1],localhost:3000will be printed)Additional context
I'll update the docs in #8634 (or update in this PR if #8634 is merged earlier).
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).