Closed wenner closed 7 years ago
OK , in my code , puth "::" to the _defaultHosts , it's work fine
portfinder._defaultHosts.push("::") //push the host in myself code
portfinder.basePort = 8080; //set basePort = 8080
portfinder.getPort(function(err , port){
console.log(port);
})
Interesting. What version of windows are u using? Thanks for any os info u can provide.
I'll check this out. I need to make a release soon and will try to handle this case. Thanks for reporting the issue.
my OSinfo : Microsoft Windows [版本 10.0.14393]
@wenner - i have to thank u - seriously - ::
might just be the the host needed to fix windows 10 support, which has been lingering as #39 for a few months now - I had a rather creative hack in mind but honestly didn't understand why windows was allowing rebinding and held off (procrastinated u could say too) b/c it just didn't make sense that they would allow rebinding to an interface with the same host + port
::
though - like u mention - is the new 0.0.0.0
- but for ipv6 - which means that while it doesn't show up when running os.networkInterfaces()
it is nonetheless a catchall non-loopback host that can be bound too and just perhaps answers why rebinding in windows 10 was seeming to occur (when, as I suspected all along, it really wasn't)
If ur interested in contributing - I'll accept adding ::
to _defaultHosts array - I can test on my mac and linux that this won't break POSIX based systems.
Let me know ur thoughts - my comment here is just preliminary and needs vetting but if it has any potential to lead to a clean solution, I'm willing to explore it.
Appreciate ur help :)
Thank you for your answer
When i run the code , i get the result is 8080;
here is log
Here is my system net information
but the 8080 Port is occupied
and there have a host [::] , then i change the code portfinder.js
it's OK and Get the right results I want 8081
i don't know why , but i think it's the ipv6 address of '0.0.0.0'
and how fix it?