fix: add hostname and port to bonjour name to prevent name collisions#2276
fix: add hostname and port to bonjour name to prevent name collisions#2276alexander-akait merged 1 commit intowebpack:masterfrom roblan:fix/bonjour
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.
|
alexander-akait
left a comment
There was a problem hiding this comment.
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.
Just question - this names is used somewhere?
Sorry, i am not familiar with bonjour,
There was a problem hiding this comment.
bonjour is used to broadcast services in current network, and it's used as service name
There was a problem hiding this comment.
maybe better use hostname from here
webpack-dev-server/lib/Server.js
Line 739 in 61b949e
There was a problem hiding this comment.
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.
@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.
@evilebottnawi not on the same machine, but this name should be unique across local network.
|
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
bonjourbecause of 'name already in use' error.Breaking Changes
No
Additional Info