1
Since I started using Mac I am no longer able to host a local server on my router with Express.
In Ubuntu just pass the router IP as second argument of app.listen
and everything worked out: thus.
When I try to run the same code on Mac OSX I get the following error:
Error: listen EADDRNOTAVAIL
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1129:19)
at listen (net.js:1172:10)
at net.js:1270:9
at dns.js:85:18
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Try shutting down the OSX firewall to see if it’s the firewall that’s blocking access (under System Preferences > Security & Privacy > Firewall).
– bfavaretto
On this jsFiddle line that you have placed this IP is not on string...
app.listen(3000, 168.192.1.1, function(err) {
. You got that right? It should beapp.listen(3000, '168.192.1.1', function(err) {
– Sergio
@Sergio Sim, this in string. The same code works on Linux.
– ropbla9
@bfavaretto The firewall is totally off.
– ropbla9
Is OSX IP dynamic or static? That IP you’re assigning comes from where? You have to give the IP of the machine you’re on.
– Sergio
@Sergio is the IP statico router.
– ropbla9