title: Socket.io sanitize incoming data (xss)
body: <p>im using socket.io in expressjs 3. And i want to sanitize incoming messages with express-validator. I have this code:</p>
  
  <pre><code>var expressValidator = require('express-validator')
  , sanitize = require('express-validator').sanitize;
  
  socket.on('chat', function (data) {
      io.sockets.in('test').emit('chat', {
              user: sh.session.user,
              message: data.message,
              time: new Date()
      });
  });
  </code></pre>
  
  <p>how do i use <code>sanitize(data.message).xss</code>? Because this does not work.</p>