Create e.g. assets/js/dependencies/app.io.js
with:
io.socket.on('connect', function socketConnected() {
console.debug("This is from the connect: ", io.socket);
console.debug("WebSocket is connected:", io.socket.isConnected());
io.socket.get('/user', function(resData) {
console.debug(resData);
});
});
Console
|> Now connected to Sails.
\___/ For help, see: ....
(using sails.io.js browser SDK @v0.13.7)
app.io.js:3 This is from the connect: SailsSocket {headers: undefined, eventQueue: Object, isConnecting: false, extraHeaders: Object, hostname: "localhost"…}
app.io.js:4 WebSocket is connected: true
app.io.js:7 Not implemented in core yet <========= WHY?
Why am I getting this message?
Any pointers on how to fix this?
we need more informations such as:
Above all i can show you how i configured my Sails backend:
in my
.sailsrc
i have the hooks configured as followsthen in my
UserController.js
i have this simple method that enables the socket communicationmy frontend uses Angular and a the ngSails module that is a sort of wrapper of 'sails.io' for Angular
and in my 'UserService.js' i can do something like
and then call the server method in order to enable the sockets
(you need also to inject the '$sails' module and configure it properly...)
Hope this could help you