title: Cant connect to WebSocket Node.JS
body: <p>i'm making a game that use WebSockets and this is the code that i use to  start a WebSocket server: </p>
  
  <pre><code>const server = require("http").Server(app);
  const port = 3005;
  server.listen(port, () =&gt; {
    console.log('Server started on port: ' + port);
  }); 
  
  var WebSocketServer = require('ws').Server;
  var wss = new WebSocketServer({ server })  
  wss.on('connection', function connection(ws) {});
  </code></pre>
  
  <p>And this code i use for connecting a user to the WebSocket:</p>
  
  <pre><code>this.SERVER_URL ='ws://localhost/?fvukovic'; &lt;-- fvukovic is the user
  this.ws = new WebSocket(this.SERVER_URL, ["test"]);      
  this.ws.onopen = () =&gt; {
    console.log('open'); 
  };
  </code></pre>
  
  <p>This works perfectly, but when i push that on server and i change the ip address to 195.201.119.221 which is the ip of the server, port is still 3005, i cant connect to it anymore..</p>
  
  <p>I get this error:
  WebSocket connection to 'ws://195.201.119.221:3005/?fvukovic' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT</p>
  
  <p>Do i need something more when i put the the app on a real server?</p>