title: How to trigger messages using socket.io?
body: <p>How is it possible to send a message using a button in html5?</p>
  
  <p>here is my code:</p>
  
  <p>server:</p>
  
  <pre><code>var io = require('socket.io').listen(72);
  
  
  io.on('connection', function(client){
      client.send('{"success": 1}');
      client.on('message', function(data) {
          console.log('Client:', data); 
      }); 
      client.on('disconnect', function() {
          console.log('Goodbye');
      }); 
  });
  </code></pre>
  
  <p>client:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;script src="http://192.168.0.102:72/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  var socket = io.connect('http://192.168.0.102:72');
  function doit(){
    socket.on('message', function(data) {
      socket.send("hi there");
     });
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;button name="Klickme" type="button" onclick="doit();"&gt;On!&lt;/button&gt;
      &lt;button id="off" type="button" onclick="close();"&gt;Off!&lt;/button&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I get no error on my client/server, but I don´t get the message either. Can Somebody give me a hint? thanks!!!</p>