Socket.io 1.0.6 client event

I am currently learning to use socket.io with node js but I'm having a hard time because I think something may have changed between versions. I have a litte demo using 1.0.4 in which I use something like this to send events from the client and receive them in the server:

SERVER

var socketio = require('socket.io');
var http = require('http');
var app = express();

var server = http.Server(app);
var io = socketio.listen(server);
var port = process.env.PORT || 8080;

server.listen(port, function(){
  console.log("Express server listening on port " + port);
});


io.on('connection', function (socket) {
    socket.emit('connected');
    socket.on('myEvent', function(){
        console.log('myEvent has been emitted');
    });  
});

CLIENT

$(document).ready(function(){
    $('#button').click(function(){
        emitEvent();
    });
});

var socket = io.connect('http://localhost:8080/');

socket.on('connected', function () {
  alert('server says I am connected');
});

function emitEvent(){
  socket.emit('myEvent');
}

With both versions I can open the socket on the client and receive the 'connected' event sent later from the server than launches the alert function. The problem here is when I want to send any other event from the client. "socket.emit('myEvent');" in the emitEvent function seems to work fine for the 1.0.4 version but not for the 1.0.6 version. I have been looking for info about the changes and trying to understand the whole module but cannot get to the solution. Does anyone know what am I doing wrong? Obviously the way sending client events has changed. I would appreciate if someone could help me with this issue. Thanks in advance.

I didn't understand the problem actually. But here's the code for your functionality.

client:

var socket = io.connect();
$('#button').click(function(){
    socket.emit('myEvent');
});
socket.on('connected', function(){
    alert "you are connected";
});

server:

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(app);
var port = process.env.PORT || 8080;
app.listen(port);
io.on('connection', function(socket){
    socket.on('myEvent', function(){
        socket.emit('connected');
        console.log('emmited succesfully');
    });
});