sockets.js 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * WebSocket Server Settings
  3. * (sails.config.sockets)
  4. *
  5. * Use the settings below to configure realtime functionality in your app.
  6. * (for additional recommended settings, see `config/env/production.js`)
  7. *
  8. * For all available options, see:
  9. * https://sailsjs.com/config/sockets
  10. */
  11. module.exports.sockets = {
  12. /***************************************************************************
  13. * *
  14. * `transports` *
  15. * *
  16. * The protocols or "transports" that socket clients are permitted to *
  17. * use when connecting and communicating with this Sails application. *
  18. * *
  19. * > Never change this here without also configuring `io.sails.transports` *
  20. * > in your client-side code. If the client and the server are not using *
  21. * > the same array of transports, sockets will not work properly. *
  22. * > *
  23. * > For more info, see: *
  24. * > https://sailsjs.com/docs/reference/web-sockets/socket-client *
  25. * *
  26. ***************************************************************************/
  27. // transports: [ 'websocket' ],
  28. /***************************************************************************
  29. * *
  30. * `beforeConnect` *
  31. * *
  32. * This custom beforeConnect function will be run each time BEFORE a new *
  33. * socket is allowed to connect, when the initial socket.io handshake is *
  34. * performed with the server. *
  35. * *
  36. * https://sailsjs.com/config/sockets#?beforeconnect *
  37. * *
  38. ***************************************************************************/
  39. // beforeConnect: function(handshake, proceed) {
  40. //
  41. // // `true` allows the socket to connect.
  42. // // (`false` would reject the connection)
  43. // return proceed(undefined, true);
  44. //
  45. // },
  46. /***************************************************************************
  47. * *
  48. * `afterDisconnect` *
  49. * *
  50. * This custom afterDisconnect function will be run each time a socket *
  51. * disconnects *
  52. * *
  53. ***************************************************************************/
  54. // afterDisconnect: function(session, socket, done) {
  55. //
  56. // // By default: do nothing.
  57. // // (but always trigger the callback)
  58. // return done();
  59. //
  60. // },
  61. /***************************************************************************
  62. * *
  63. * Whether to expose a 'GET /__getcookie' route that sets an HTTP-only *
  64. * session cookie. *
  65. * *
  66. ***************************************************************************/
  67. // grant3rdPartyCookie: true,
  68. };