-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: add hostname and port to bonjour name to prevent name collisions #2276
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2276 +/- ##
==========================================
+ Coverage 93.92% 93.92% +<.01%
==========================================
Files 34 34
Lines 1283 1284 +1
Branches 369 366 -3
==========================================
+ Hits 1205 1206 +1
- Misses 71 77 +6
+ Partials 7 1 -6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need test for this case
@evilebottnawi test added |
|
||
bonjour.publish({ | ||
name: 'Webpack Dev Server', | ||
name: `Webpack Dev Server ${os.hostname()}:${port}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just question - this names is used somewhere?
Sorry, i am not familiar with bonjour
,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonjour is used to broadcast services in current network, and it's used as service name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better use hostname
from here
webpack-dev-server/lib/Server.js
Line 739 in 61b949e
return this.listeningApp.listen(port, hostname, (err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've check it, and it's set to 'localhost' (by default I think and it will be in 9/10 cases) so it could still colide with some other webpack-dev-server in local network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roblan port should be difference in this case, you can't run multiple webpack-dev-server using the same port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evilebottnawi not on the same machine, but this name should be unique across local network.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Need fix lint problem and we can merge |
Should be ok now |
Thanks! |
For Bugs and Features; did you add new tests?
Yes
Motivation / Use-Case
It was impossible to run mutliple instances of webpack-dev-server if they all had
bonjour
because of 'name already in use' error.Breaking Changes
No
Additional Info