-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
We should use a more rigorous logic to resolve the port of the dev server and the ‘printServerUrls’ function #7271
Labels
Comments
libmw
added a commit
to libmw/vite
that referenced
this issue
Mar 11, 2022
Closed
9 tasks
It's been two months and vite still hasn't fixed the problem,so sad 👎 |
PR welcome. |
so why my pr #7274 can not be merged?thanks. |
9 tasks
@libmw Your PR is not passing tests. Would you fix it? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Clear and concise description of the problem
As a developer using Vite I want optimize
the resolve logic of develop server port
and theserver running at...
log.So that user can visit thier dev server correctlly.I intend to submit a PR for this issue.
Vite is able to find another port when the candidate port is used by other program,but it's not rigorous sometimes.
Incorrect localhost
Vite will show unreachable ip
Suggested solution
I don't know if the above questions are bugs or rules,but I still try to optimize them.
For port conflicts I try to optimize by
If option host is undefined or :: or 0.0.0.0, user mostly want to visit thier server by every address.I would check all local address to see if they are used by option port.
If option host is 127.0.0.1 or localhost,user mostly want to visit thier server by localhost.I would check 127.0.0.1 and ::1 and :: with option port to make sure that users can use localhost to access thier server.
For other host I only chek the specific option host and user can only visit thier server by it.
For each of the conflict port, I'll show whitch host it used by.
For
printServerUrls
I use these logicFor ipv6 networkInterface address:
For ipv4 networkInterface address:
Alternative
No response
Additional context
I am working on a PR for implementing this feature.
Validations
The text was updated successfully, but these errors were encountered: