Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket is trying to reconnect to Sails... Even after disabling socket.io #3580

Closed
tarunjadhwani opened this issue Feb 17, 2016 · 5 comments
Closed
Labels

Comments

@tarunjadhwani
Copy link

I'm using the latest version of sails 0.12.1. I've added these lines in .sailsrc to disable socket.io:

{
  "hooks": {
    "sockets": false,
    "pubsub": false
  },
  "generators": {
    "modules": {}
  }
}

But we I see in network, I get a 404 error as socket is still trying to connect to https://abcdemo.com/socket.io/?__sails_io_sdk_version=0.…owser&__sails_io_sdk_language=javascript&EIO=3&transport=polling&t=LBjxAme

@sgress454
Copy link
Member

The 404 is coming from a client-side socket attempting to connect to the server, which isn't accepting socket connections (because you turned the hook off). You need to remove the sails.io.js script from whatever page you're loading. Assuming it's just being added to your layout.ejs file by Grunt, and assuming you don't need it for anything (since you're not using sockets), the easiest thing is just to remove the file from assets/js/dependencies, and Grunt will no longer add the <script> tag including it in your layout.

@karsasmus
Copy link

Did you delete the sails.io.js in "assets/js/dependencies"?
I think disabling the hooks is for sails backend functionality and grunt doesn't know about to delete the sails.io.js file after disabling these (backend) hooks.

If you want enable these hooks later again, you can generate the sails.io.js file via "sails generate sails.io.js"

@mikermcneil
Copy link
Member

@karsasmus @sgress454 spot on, thanks guys!

@tarunjadhwani if you can remember offhand where you found info on disabling the sockets hook, would you mind linking to this issue or writing up a couple of sentences about the solution there? (e.g. as comment on SO question or PR to sails-docs) It'd be a big help to other folks who might run into this in the future. Thanks!

@sailsbot
Copy link

Thanks for posting, @tarunjadhwani. I'm a repo bot-- nice to meet you!

The issue queue in this repo is for verified bugs with documented features. Unfortunately, we can't leave some other types of issues marked as "open". This includes bug reports about undocumented features or unofficial plugins, as well as feature requests, questions, and commentary about the core framework. Please review our contribution guide for details.

If you're here looking for help and can't find it, visit StackOverflow, our Google Group or our chat room. But please do not let this disrupt future conversation in this issue! I am only marking it as "closed" to keep organized.

Thanks so much for your help!

If I am mistaken, and this issue is about a critical bug with a documented feature, please accept my sincerest apologies-- I am but a humble bot working to make GitHub a better place. If you open a new issue, a member of the core team will take a look ASAP.

@tarunjadhwani
Copy link
Author

@mikermcneil Sure I'll do that. Thanks @sgress454 @karsasmus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants