title: Ubuntu open/unblock ports for nodejs
body: <p>I'm trying to listen port 8080 for socket.io but I get error:  </p>
  
  <pre><code>http://localhost:8080/socket.io/?EIO=3&amp;transport=polling&amp;t=Lai1FQh net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>I'm using ubuntu virtual machine from digitalocean and first when I ssh login I get message:<br>
   <code>The "ufw" firewall is enabled. All ports except for 22, 80, and 443 are BLOCKED</code>.  </p>
  
  <p>I'm beginner with this but doesn't that mean that port <code>8080</code> is blocked.<br>
  How do I fix this and what I need to do</p>
  
  <p>Here is my code for server:</p>
  
  <pre><code>var socket = require( 'socket.io' );
  var express = require( 'express' );
  var http = require( 'http' );
  
  var app = express();
  var server = http.createServer( app );
  
  var io = socket.listen( server );
  
  server.listen(8080, function(){
      console.log("Listening");
  })
  </code></pre>
  
  <p>In my website i just connect to that port like this:</p>
  
  <pre><code>&lt;script src="node_modules/socket.io-client/dist/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      var socket = io.connect( 'http://localhost:8080' );
      ...
  &lt;script&gt;
  </code></pre>