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

engine.io-client 1.6.9 makes node.js socketio calls hang #396

Closed
ksylvan opened this issue May 22, 2016 · 8 comments
Closed

engine.io-client 1.6.9 makes node.js socketio calls hang #396

ksylvan opened this issue May 22, 2016 · 8 comments

Comments

@ksylvan
Copy link

ksylvan commented May 22, 2016

This is related to socketio/socket.io-client#969

Again, not sure why the npm package is 1.6.9 while the source code here is only at version 1.6.8

I traced the problem down to the engine.io-client 1.6.9 update in the socket.io-client update.

After npm install --save socket.io-client I changed the package.json reference to be for 1.6.8:

/usr/src/app $ grep engine.io-client node_modules/socket.io-client/package.json 
"engine.io-client": "1.6.8",

And now my tests work:

$ ./test/run_tests InfoController

  InfoController
    /version:
  ✓ should return json (57ms)
  ✓ should have valid json info
  InfoController with sockets
    /version:
  ✓ should return data
  3 passing (16s)

Changing it back to 1.6.9, here is what happens:

$ ./test/run_tests InfoController

 InfoController
    /version:
  ✓ should return json (41ms)
  ✓ should have valid json info 
  InfoController with sockets
    /version:
  1) should return data
  2 passing (12s)
  1 failing    
  1) InfoController with sockets /version: should return data:
     Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.
@kapouer
Copy link
Contributor

kapouer commented May 22, 2016

It's not uncommon that upstream authors forget to git push && git push --tags.
For the problem you're seeing: is it that you have socket.io 1.6.8 on server, and socket.io-client 1.6.9 ?

@kapouer
Copy link
Contributor

kapouer commented May 22, 2016

Are you using certificates ?
Because socketio/engine.io-client@2c55b27 has changed default behavior.

@ksylvan
Copy link
Author

ksylvan commented May 22, 2016

Yes I am using certificates.

I'm using sails.js on the server and mocha with socket.io-client for the unit tests.

@kapouer
Copy link
Contributor

kapouer commented May 22, 2016

That's the only change between 1.6.8 and 1.6.9. The server version bump is a dull. The client changes only that behavior. It should have been a minor version bump at least...
Anyway, just set opts.rejectUnauthorized = false; and you're good to go !

@ksylvan
Copy link
Author

ksylvan commented May 22, 2016

Thank you for your response! I'm using the sails.io.js wrapper to connect to socket.io-client and engine.io. I don't see what the easy way is to set that option.

https://github.com/balderdashy/sails.io.js#for-nodejs

@kapouer
Copy link
Contributor

kapouer commented May 22, 2016

Usually you can pass options, please see that with sails.io.js.

@ksylvan
Copy link
Author

ksylvan commented May 22, 2016

balderdashy/sails.io.js#103 fixes the issue for me, along with setting the connection option before sails initiates the socket connection.

@darrachequesne
Copy link
Member

Closing, as this is now fixed in sails.io.js.

darrachequesne pushed a commit that referenced this issue May 8, 2020
Switched xmlhttprequest dependency to a versioned one
darrachequesne pushed a commit that referenced this issue May 8, 2020
Also remove duplicate deps and re-add component-inherit

Closes #384, closes #358, closes #348, closes #402
darrachequesne pushed a commit that referenced this issue May 8, 2020
package: remove 'xmlhttprequest' dep to restore fix from #396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants