-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: print resolved address for localhost #8647
Merged
patak-dev
merged 9 commits into
vitejs:main
from
sapphi-red:feat/print-resolved-address-for-localhost
Jun 20, 2022
Merged
feat: print resolved address for localhost #8647
patak-dev
merged 9 commits into
vitejs:main
from
sapphi-red:feat/print-resolved-address-for-localhost
Jun 20, 2022
Conversation
This file contains 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
sapphi-red
added
p2-nice-to-have
Not breaking anything but nice to have (priority)
breaking change
labels
Jun 18, 2022
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.printUrls
are now async.Description
#8543 used
verbatim: true
to makelocalhost
resolved 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:3000
Other server:
[::]:3000
Log output:
localhost:3000
=>[::1]:3000
Mismatch#8543
Vite:
localhost:3000
=>[::1]:3000
Other server:
[::]:3000
Log output:
localhost:3000
=>[::1]:3000
This PR
Vite:
localhost:3000
=>[::1]:3000
Other server:
[::]:3000
Log output:
[::1]:3000
(if DNS resolves to[::1]
,localhost:3000
will 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
).