title: Call specific functions with Websockets?
body: <p>I'm trying to deploy an app with Heroku but I guess they don't allow use of Socket.IO so I have to use basic WebSockets. How do I send data to specific functions e.g.</p>
  
  <p>With sockets it would be:</p>
  
  <pre><code>// Server
  socket.on('testFunction', function(data) {
    console.log(data);
  });
  
  // Client
  socket.emit('testFunction', 'Hello!');
  </code></pre>
  
  <p>But with Websockets from what I've googled all I can find is</p>
  
  <pre><code>// Server
  ws.onmessage = function(data) {};
  
  // Client
  ws.send('This is a string, what do I do with myself');
  </code></pre>
  
  <p>Any information would be great. Thanks!</p>