title: Can the socket.io client emit events locally?
body: <p>Is it possible to use socket.io to dispatch events to the client and not send them to the server? Something like:</p>
  
  <pre><code>socket.emitLocally('some event', data);
  </code></pre>
  
  <hr>
  
  <p><strong>Here is why I'm asking:</strong></p>
  
  <p>At the moment my server emits events to all sockets. </p>
  
  <pre><code>io.sockets.emit()
  </code></pre>
  
  <p>While this works well, there is the possibility of a delay between the user interaction and the response from the server.</p>
  
  <p>This is why I would prefer to use broadcast on the server side and handle things immediatly in the broadcasting client.</p>
  
  <pre><code>socket.broadcast.emit()
  </code></pre>
  
  <p>The client is based on angular.js and the modules don't know of each other. I can't access the code that is responsible for updating the client directly. I would have to use some kind of event dispatching service which I would inject into relevant modules.</p>
  
  <p>Since this is basically <a href="https://github.com/marcorei/lunchpad/blob/master/dev/js/service.socket.js" rel="nofollow">what I am doing with socket.io right now</a> I wonder if I could not simply use their system to do this.</p>
  
  <p>Thank you for any input or suggestions!</p>