server.listen hostName issue

54 views
Skip to first unread message

敬錞潘

unread,
Jun 27, 2014, 1:13:00 AM6/27/14
to nod...@googlegroups.com
How to fix this hostName assign issue below?

server.listen(app.get('port'),"123.xxx.xxx.xxx");//this is my ip ,not ok
//server.listen(app.get('port'),"127.0.0.1");//ok ,can run in webbrowser                
console.log("Express server listening on port " + app.get('port'));
console.log(server.address());


events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1023:19)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3 

mscdex

unread,
Jun 27, 2014, 5:26:40 AM6/27/14
to nod...@googlegroups.com
On Friday, June 27, 2014 1:13:00 AM UTC-4, 敬錞潘 wrote:
How to fix this hostName assign issue below?

server.listen(app.get('port'),"123.xxx.xxx.xxx");//this is my ip ,not ok
//server.listen(app.get('port'),"127.0.0.1");//ok ,can run in webbrowser                


Are you sure that you have a network interface (e.g. eth0, eth1, etc.) that has "123.xxx.xxx.xxx" assigned to it?
Reply all
Reply to author
Forward
0 new messages