I can't understand one thing- does NodeJS allow to listen to custom hostname? Not localhost. Because when I listen to my website url (example.com), I'm getting the following error:
Error: listen EADDRNOTAVAIL example.com ip-address:1000 at Object.exports._errnoException (util.js:1022:11) at exports._exceptionWithHostPort (util.js:1045:20) at Server._listen2 (net.js:1246:19) at listen (net.js:1295:10) at net.js:1405:9 at _combinedTickCallback (internal/process/next_tick.js:77:11) at process._tickCallback (internal/process/next_tick.js:98:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9)
Why does it happend? And can I listen for POST messages from external site URL?
example.com
resolves to the IP of the machine you are running this server, then you should be able to listen onexample.com
. Please check which addressexample.com
resolves to in your case. – volatilevar