title: Socket.io local network not connecting
body: <p>Okay, I have the following setup: <a href="https://i.stack.imgur.com/4T9SX.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/4T9SX.jpg</a> ( If image below is too small )</p>
  
  <p><a href="https://i.stack.imgur.com/4T9SX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4T9SX.jpg" alt="enter image description here"></a></p>
  
  <p>The problem is that Computer 2 can not connect with socket.io to computer 1.</p>
  
  <p><a href="https://i.stack.imgur.com/AbIhy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AbIhy.png" alt="enter image description here"></a></p>
  
  <p>Yes i included socket.io in computer 2:</p>
  
  <p><a href="https://i.stack.imgur.com/w6DDk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w6DDk.png" alt="enter image description here"></a></p>
  
  <p>Any ideas as to why Computer 2 cannot connect to computer 1 with socket.io whilst ping can?</p>
  
  <p>Extra information:
  - Socket.io version 1.4.5
  - Both computers are windows 10
  - Computer 2 javascript is in Phonegap
  - Computer 2 connects via wi-fi, computer 1 via ethernet</p>
  
  <p>Greetings</p>
  
  <p><strong>EDIT</strong>
  Code from client (computer 2, init is called upon start):</p>
  
  <pre><code>KerstAppHome.prototype.init = function(){
      var address = 'http://192.168.2.120:2017';
      console.log("Connecting to: " + address);
      this.socket = io.connect(address);
      this.socket.on('connect', this.proxy(function(){
          console.log("Connected to socket!");
          this.socketIsConnected = true;
  
          this.socket.on('disconnect', this.proxy(function(){
              console.log("Disconnected from socket!")
              this.socketIsConnected = false;
          }));
          this.socket.on('musicBlob', this.proxy(this.onMusicBlobReceived))
      }));
  
  };
  
  KerstAppHome.prototype.onMusicBlobReceived = function(musicBlob){
      console.log("RECEIVED SOMETHING");
      this.audioCtx.decodeAudioData(musicBlob).then(this.proxy(function(audioBuffer) {
          var source = this.audioCtx.createBufferSource();
          source.buffer = audioBuffer;
          source.connect(this.audioCtx.destination);
          source.start();
      }));
  }
  </code></pre>
  
  <p>Code from server (computer 1):</p>
  
  <pre><code>var port = 2017;
  var io = require('socket.io')(port);
  console.log("Listening for socket connections on port " + port);
  
  io.on('connection', function (socket) {
      console.log("Connection made!");
      socket.on('musicBlob', function(musicBlob){
          socket.broadcast.emit('musicBlob', musicBlob);
      });
  });
  </code></pre>
  
  <p>Relevant code from browser ( computer 1 ):</p>
  
  <pre><code>var socket = io.connect('http://localhost:2017');
  var socketIsConnected = false;
  
  socket.on('connect', function(){
      console.log("Connected to server!");
      socketIsConnected = true;
  });
  socket.on('disconnect', function(){
      console.log("Disconnected from server!")
      $scope.socketIsConnected = false;
  });
  </code></pre>
  
  <p>I want to know why computer 2 can't even connect to the server, 
  The console.log("Connected to socket!"); is not even called  </p>
  
  <p><strong>NOTE: If I execute the javascript of the client (computer 2) on computer 1, it works perfectly, makes connection and receives data!</strong></p>
  
  <p><strong>NOTE: I tested it with computer 1 (server) his firewall turned off and it worked perfectly!</strong></p>