title: Express.io and Android
body: <p>I have been working in a chat app using nodejs and socket.io. I already have an Android client that works perfect in this schema. I started to use express.io instead of use express an socket.io separately. Everything works well except for my Android client. Im using <a href="https://github.com/socketio/socket.io-client-java" rel="nofollow">https://github.com/socketio/socket.io-client-java</a> socket client in Android, but my app never connect to my socket server.</p>
  
  <p>I received the following error:
  io.socket.engineio.client.EngineIOException: server error</p>
  
  <p>Does anybody knows something about this issue?</p>
  
  <p>Server side config:</p>
  
  <pre><code>    var express = require('express.io');
      var path = require('path');
      var logger = require('morgan');
      var bodyParser = require('body-parser');
      var multer  = require('multer');
  
      var app = express();
  
      app.http().io()
  
  
      app.io.route('storeClientInfo', function(req) {
  
          req.io.join(req.io.request.data.customId);
  
      });
  
      app.io.route('enviar_room', function(req) {
  
        app.io.room(req.params.correo).broadcast('new visitor');
  
      });
  
      // Start the server
  
      app.set('port', process.env.PORT || 3000);
  
        var server = app.listen(app.get('port'), function() {
         console.log('Express server listening on port ' +                                     server.address().port);
        });
  </code></pre>
  
  <p>Android side:</p>
  
  <pre><code>    @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      try {
  
          mSocket = IO.socket(LoginActivity.URL_HOST);
          mSocket.on(Socket.EVENT_CONNECT_ERROR, onConnectError);
          mSocket.on("new visitor",onNuevoMensaje);
      }
      catch(Exception ex)
      {
        ex.printStackTrace();
      }
      }
  
      private Emitter.Listener onConnectError = new Emitter.Listener() {
      @Override
      public void call(Object... args) {
  
          Log.d("SocketMsg: ", args[0].toString());
  
          for (Object o : args) {
              Log.i("IO " + Socket.EVENT_CONNECT_ERROR, o.toString());
          }
  
          runOnUiThread(new Runnable() {
              @Override
              public void run() {
                  Toast.makeText(getApplicationContext(),
                          "CONNECT ERROR", Toast.LENGTH_LONG).show();
  
  
              }
          });
      }
  };
  </code></pre>
  
  <p>Currently I already have a Angularjs web version running with my server. The problem is that in Android i always received Socket.EVENT_CONNECT_ERROR.</p>