title: SailsJS - using sails.io.js with JWT
body: <p>I have implemented an AngularJS app, communicating with Sails backend through websockets, using sails.io.js. </p>
  
  <p>Since the backend is basically a pure API and will be connected to from other apps as well, I'm trying to disable sessions completely and use JWT. </p>
  
  <p>I have set up express-jwt and can use regular HTTP requests quite nicely, but when I send a request through sails.io.js, nothing happens at all - websocket request keeps pending on the client, and there's nothing happening on the server (with "silly" log level).</p>
  
  <p>I've tried patching sails.io.js to support the <a href="https://github.com/balderdashy/sails.io.js/pull/46">query parameter</a>, and when connecting, I send the token from Angular, but in the best case, I get a response with error message coming from express-jwt saying credentials are missing...</p>
  
  <p>I've also seen some hints that socket.js in sails needs to be modified with beforeConnect, I've seen <a href="https://github.com/auth0/socketio-jwt">socketio-jwt</a>, but have no idea where and how to plug that in, in Sails.</p>
  
  <p>Has anyone implemented this and is using JWT with Sails and sockets? I'd appreciate any kind of hint in what direction to go :)</p>