title: Cannot connect angular front to node backend
body: <p>I'm currently developing game app. I have started with authorization via FB and now i got stuck on connecting front-end angular with back-end node.
  My folder contains 2 subfolders without any connections or dependencies between them: <strong>client</strong> and <strong>server</strong>.</p>
  
  <p><strong>Client</strong> contains scaffolded yeoman application based on angular generator so that my front end is fired with <em>grunt serve</em>. I'm using here angular-socket-io by btford.</p>
  
  <p><strong>Server</strong> contains nothing but basic server allowing to connect and loggs to console when someone will connect via socket.io.</p>
  
  <p>My problem lies on client folder, front-end part, where:</p>
  
  <pre><code>angular.module('battleshipsApp')
      .factory('socket', function (socketFactory) {
          var myIoSocket = io.connect('http://localhost:5432');
          var mySocket = socketFactory({
              ioSocket: myIoSocket
          });
         return mySocket;
      });
  </code></pre>
  
  <p>doesn't work.</p>
  
  <p>I think i linked  everything i needed:</p>
  
  <pre><code>src="bower_components/angular-socket-io/socket.js"
  &lt;!-- endbower --&gt;
  &lt;!-- endbuild --&gt;
  src="bower_components/angular-socket-io/mock/socket-io.js"
  </code></pre>
  
  <p>Here my simple server:</p>
  
  <pre><code>var app = require('express')();
  var http = require('http').Server(app);
  var io = require('socket.io')(http);
  
  app.get('/', function(req, res){
    res.sendFile(__dirname + '/index.html');
  });
  
  io.sockets.on('connection', function(socket){
      var logIn = new Date();
      console.log(logIn + ' user connected')
  
      socket.on('disconnect', function() {
      var logOut = new Date();
          console.log(logOut + ' bye bye')
      })
  });
  
  http.listen(5432, function(){
    console.log('listening on localhost:5432');
  });
  </code></pre>
  
  <p>And I can't figure out why these two cannot connect.
  I couldn't find any answers which could fit my problem in google.
  I'm looking right now on both terminals, one with <em>grunt serve</em> in action and one with <em>nodemon server.js</em> and no errors, no connections.
  Also there are no errors on dev tools console in chrome on front-end side.</p>
  
  <p>Any help? Or maybe approach for this app with my structure is bad?</p>