techpines / express.io

Realtime Micro Framework for Nodejs
express-io.org
1.59k stars 234 forks source link

Canonical example doesn't work #127

Closed mpaolino closed 7 years ago

mpaolino commented 9 years ago

Not sure if I'm doing something wrong, but looks like latest express.io (~1.1.13) does not work well with latest socket.io-client (1.3.7).

Canonical example:

Server:

app = require('express.io')()
app.http().io()

// build realtime-web app
app.listen(7076)

Client:


var io = require('socket.io-client');
var socket = io.connect('http://127.0.0.1:7076', {reconnect: true});

socket.on('connect', function(){
  console.log("Connected!");
}); 
socket.on('connect_error', function(err){
  console.log("Error on connection: " + err);
}); 
socket.on('event', function(data){
  console.log("Got event");
});
socket.on('disconnect', function(){
  console.log("Disconnected");
});

Client output:

Error on connection: Error: server error

The client does work well against http://chat.socket.io

mpaolino commented 7 years ago

No answer, closing.