title: Socket.io emit not called
body: <p>I am trying to emit two things from disconnection, and one is a redirect. </p>
  
  <p>Server side:</p>
  
  <pre><code> socket.on('disconnect', () =&gt; {
      socket.broadcast.emit('user-disconnected', users[socket.id]);
      socket.emit('redirect', destination);
      console.log('disconnect: '+ users[socket.id]);
      delete users[socket.id];
    });
  </code></pre>
  
  <p>Client side:</p>
  
  <p>This gets called greatly:</p>
  
  <pre><code>socket.on('user-disconnected', username =&gt; {
      appendMessage(username+ ' est parti.');
      removeUser(username);
  });
  </code></pre>
  
  <p>This does not:</p>
  
  <pre><code>socket.on('redirect', function(destination) { // never gets called…
      window.location.href = destination;
  });
  </code></pre>
  
  <p>Do you know why my server-side gets called, user-disconnected does, but not my redirect ?</p>
  
  <p>Thank you so much if you help!</p>