How to disable socket.io in sails.js?

I want to disable the socket.io service, in this version of the development phase I was not ready to use it, how can I configure?

+4
source share
3 answers

To disable it on the server side, follow these steps: https://gist.github.com/mikermcneil/8911041

Then, on the client side, simply delete the .js files that initialize it.

+4
source

For me "sockets":falsein .sailsrc or sails / hooks.js does not work.

sails v0.12.13, node v7.4.0.

I just added this to config / sockets.js

beforeConnect: function(handshake, cb) {
  return cb('socket connections not allowed!', false);
},
+1
source

.

  • js/dependencies/sails.io.js
  • HTML script .

<script src="/js/dependencies/sails.io.js"
  autoConnect="false"
  environment="production"
  headers='{ "x-csrf-token": "<%= typeof _csrf === 'undefined' ? _csrf : '' %>" }'>
</script>
Hide result

˚

0

Source: https://habr.com/ru/post/1528970/


All Articles