Siraj Abbas Siraj Abbas - 11 days ago 6
Node.js Question

windows server run nodejs app on port 80

I am having a windows server which has already a asp.net application hosted and also several websites using IIS.Now i have to host a nodejs application on a domain.But i cant run this app on port 80.it showing following error.

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>cd C:\inetpub\wwwroot\app

C:\inetpub\wwwroot\app>node server.js
(node) util.puts is deprecated. Use console.log instead.
Http Server running at http://serverip:80/
events.js:141
throw er; // Unhandled 'error' event
^

Error: listen EACCES serverip:80
at Object.exports._errnoException (util.js:849:11)
at exports._exceptionWithHostPort (util.js:872:20)
at Server._listen2 (net.js:1218:19)
at listen (net.js:1267:10)
at net.js:1376:9
at doNTCallback3 (node.js:441:9)
at process._tickCallback (node.js:347:17)
at Function.Module.runMain (module.js:477:11)
at startup (node.js:118:18)
at node.js:952:3

C:\inetpub\wwwroot\app>node server.js
(node) util.puts is deprecated. Use console.log instead.
Http Server running at http:/serverip:80/
events.js:141
throw er; // Unhandled 'error' event
^

Error: listen EACCES serverip:80
at Object.exports._errnoException (util.js:849:11)
at exports._exceptionWithHostPort (util.js:872:20)
at Server._listen2 (net.js:1218:19)
at listen (net.js:1267:10)
at net.js:1376:9
at doNTCallback3 (node.js:441:9)
at process._tickCallback (node.js:347:17)
at Function.Module.runMain (module.js:477:11)
at startup (node.js:118:18)
at node.js:952:3

C:\inetpub\wwwroot\app>

C:\inetpub\wwwroot\app>


On research i came to know that IIS is using port 80.Is there any way to host the app on port 80 along with other asp.net applications?
Thanks in advance.

Answer

To your answer: For TCP, NO. You can only have one application listening on a single port at one time. Now if you have 2 network cards, you can have one application listen on the first IP and run second application on second IP using the same port number.

For UDP (Multicasts), multiple applications can subscribe to the same port.

Comments