title: Emitting socket.io event from Sails.JS and handling it on server using Sails.JS skeleton
body: <p>I have a problem in understanding the concept of sending socket.io events from Sails.js client side controller and handling them in server-side controllers. First of all, I have downloaded the SailsJS project skeleton using npm and the structure as follows:</p>
  
  <p>Project:</p>
  
  <pre><code>api
  --adapters
  --controllers
  ----server_userController.js
  --models
  --polices
  --services
  
  assets
  --[styles, views, images, bower_components, and etc]
  --js
  ----controllers
  ------userController.js
  ----app.js
  ----sails.io.js
  ----socket.io.js
  config
  node_modules
  views
  </code></pre>
  
  <p>I wrote the following in "assets/js/controllers/server_userController.js":</p>
  
  <pre><code>socket.emit('getUser', {
      _id: 10
  });
  </code></pre>
  
  <p>Now, how to specify which server-side controller is responsible for handling this event, and how? I want this event to be received in "api/controllers/server_userController.js". So, something like this will be in the controller:</p>
  
  <pre><code>module.exports = {
    //Handling socket request here
    //Emitting socket request
  };
  </code></pre>
  
  <p>Thanks in advance</p>