简体   繁体   中英

why servername:port does not work why localhost:port in node.js works?


I am node newbie. I have a windows server, where I am running node.js with webserver.js . Start the node with webserver.js. Fireup the IE and when I tried localhost:port/index.html, the page shows properly in the IE. Now if I change the localhost to servername:port/index.html, IE is unable to display the page ('IE cannot display the webpage with you can try diagnose connection problem). Is there anything I need to enable in node so it is available outside localhost? I have jenkins runs on the same server, I did not do anything and it shows up properly with the server name. Just curious.

Thanks

my problem was that, I used the code from the link, in the link it was use IP address, I changed it to server name, now I am able to hit the link using both server and proper url. Hope this might help others. I did not change to use netstat though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM