HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/nowruzgan/rest/node_modules/sails-hook-sockets/index.js
/**
 * `sockets` hook
 */

module.exports = function (app){
  return {

    defaults: require('./lib/defaults'),

    configure: require('./lib/configure')(app),

    initialize: require('./lib/initialize')(app),

    routes: {

      // Before the app's routes...
      before: {

      },

      // After the app's routes (i.e. if none matched)...
      after: {

        // This "shadow" route can be disabled by setting:
        // `sails.config.sockets.grant3rdPartyCookie: false`
        'GET /__getcookie': function (req, res, next) {
          if (!app.config.sockets.grant3rdPartyCookie) {
            return next();
          }
          // We explicitly set Content-Type to javascript, because some servers
          // require this when the header X-Content-Type-Options is set to
          // 'nosniff'
          res.set('Content-Type', 'application/javascript');
          res.send('_sailsIoJSConnect();');
        }

      }
    },

    // Default no-op admin bus
    broadcastAdminMessage: function() {},
    blastAdminMessage: function() {}

  };
};