title: cannot externally connect to my Node.Js server? (DUPLICATE)
body: <p>server:</p>
  
  <pre><code>var http = require('http')
  var fs = require('fs')
  
  //404
  function _404(response) {
      response.writeHead(404, {'Context-Type': 'text/plain'})
      response.write('error 404, not found')
      response.end()
  }
  
  http.createServer(onRequest).listen(8080)
  console.log('server is running')
  
  function onRequest(request, response) {
      if (request.method == 'GET' &amp;&amp; request.url == '/') {
          response.writeHead(200, {'Context-Type': 'text/html'})
          fs.createReadStream('./testhtml.html').pipe(response)
      } else {
          _404(response)      
      }
  }
  </code></pre>
  
  <p>works fine when i enter into my browser and call with localhost:8080, but am trying to connect to it with my phone (not on this network connection, but 4G) by entering my ip and port (XXX.XXX.XXX.XXX:8080)</p>
  
  <p>Why is this not working, am i doing something wrong?</p>