Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable socket.io in sails.js?

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

like image 987
zieglar Avatar asked Feb 13 '23 16:02

zieglar


2 Answers

To disable it on the server side do this: https://gist.github.com/mikermcneil/8911041

Then on the client side just remove the .js files that initialize it.

like image 103
Lenny Avatar answered Mar 06 '23 02:03

Lenny


For me "sockets":false in .sailsrc or sails/hooks.js is not working.

sails v0.12.13, node v7.4.0.

I simply added this to config/sockets.js

beforeConnect: function(handshake, cb) {
  return cb('socket connections not allowed!', false);
},
like image 42
DerekC Avatar answered Mar 06 '23 04:03

DerekC