title: How to make my computer as a public server in NodeJS or any other way?
body: <p>I want to make my computer as a public server. I tried to it with following code with NodeJS. Instead of giving hostname as 127.0.0.1 i maked it with my real ip address. but it didn't works. what is the reason? Is it possible to create a public server in that way? Or Is there any other alternative ways?  </p>
  
  <pre><code>const http = require('http');
  
  const hostname = '175.157.210.25';
  const port = 3000;
  
  const server = http.createServer((req, res) =&gt; {
      res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
  });
  
  server.listen(port, hostname, () =&gt; {
      console.log(`Server2 running at http://${hostname}:${port}/`);
  });
  </code></pre>
  
  <p>output</p>
  
  <pre><code>C:\Users\Nuwanst\Documents\NodeJS\test2&gt;node app.js
  events.js:160
        throw er; // Unhandled 'error' event
        ^
  
  Error: listen EADDRNOTAVAIL 175.157.210.25:3000
      at Object.exports._errnoException (util.js:1018:11)
      at exports._exceptionWithHostPort (util.js:1041:20)
      at Server._listen2 (net.js:1245:19)
      at listen (net.js:1294:10)
      at net.js:1404:9
      at _combinedTickCallback (internal/process/next_tick.js:83:11)
      at process._tickCallback (internal/process/next_tick.js:104:9)
      at Module.runMain (module.js:606:11)
      at run (bootstrap_node.js:389:7)
      at startup (bootstrap_node.js:149:9)
  
  C:\Users\Nuwanst\Documents\NodeJS\test2&gt;node app.js
  events.js:160
        throw er; // Unhandled 'error' event
        ^
  
  Error: listen EADDRNOTAVAIL 175.157.210.25:3000
      at Object.exports._errnoException (util.js:1018:11)
      at exports._exceptionWithHostPort (util.js:1041:20)
      at Server._listen2 (net.js:1245:19)
      at listen (net.js:1294:10)
      at net.js:1404:9
      at _combinedTickCallback (internal/process/next_tick.js:83:11)
      at process._tickCallback (internal/process/next_tick.js:104:9)
      at Module.runMain (module.js:606:11)
      at run (bootstrap_node.js:389:7)
      at startup (bootstrap_node.js:149:9)
  </code></pre>