-
Notifications
You must be signed in to change notification settings - Fork 567
Option wsEngine or EIO_WS_ENGINE env var #390
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
Conversation
Okay then, it seems these options are Server options and that would of course explain it. Then I just wonder about eio_ws_module -> shouldn't that one be in caps? Other environment variables in the sources are in caps. |
Are they ? Damn |
It seems they are only Server options. They have different options for Socket which would be the client if I understand things. |
But you should still keep the name of EIO_SERVER_WS_MODULE since that one is global to the process. But wsModule can stay. |
This project seems dead, they aren't accepting any PRs for months. |
Not dead. Crystalized :) |
Well it's dead to me if they are just going to ignore PR's and not respond to any questions. They can call themselves "fastest" (note: superlative) just like everyone is doing these days even though this is very far from the truth. I don't care anymore. |
@alexhultman @kapouer I'm open to also adding a specific test that involves using |
Test is coming |
@rauchg i went a little further than a specific test. Also i removed the |
|
||
opts = opts || {}; | ||
|
||
this.wsEngine = opts.wsEngine || process.env.EIO_WS_ENGINE || 'ws'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same problem again? The option itself can be 'wsEngine' but the (global to the process) should probably be named something implying it's only a server option, right? EIO_SERVER_WS_ENGINE but option wsEngine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record (i replied somewhere else already):
EIO_WS_ENGINE for engine.io
EIO_CLIENT_WS_ENGINE for engine.io-client
If you expect the test to succeed we need to depend on uws so that it downloads and installs it. |
Amen to that, i just committed in wrong order. |
Is it possible to run the entire test two times, one with ws and one with uws? |
that's precisely what 53b6ae5 does |
or to be more precise, there's one test for the wsEngine option alone, and all tests are run twice. |
Provided you run them using |
As an engine.io user, (used to the xxx, xxx-client convention) i'd expect env vars to be |
Let me fix order of commits... |
I will need to push a new version to pass the last 3 tests, will do shortly. |
@kapouer Should I link statically this release or should we fix the travis g++? You should be able to modify the .travis.yml yourself? |
I can add that modification to the PR, indeed |
Okay I published v0.3.4 that passes every test. I did link statically in this build still. |
I don't think static linking was needed ? The problem here is more about travis config - i'm pretty sure the config i added in the |
It seems you are not downloading the latest version? It's failing where it shouldn't fail if you have the latest ver. |
package.json
Outdated
"s": "0.1.1", | ||
"superagent": "0.15.4" | ||
"superagent": "0.15.4", | ||
"uws": "^0.3.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be at least ^0.3.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, it should specify an exact version. Not a version range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess fix version is okay but in that case you will get many PRs from me, wanting to up the version when I fix things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, since it's in the devDependencies, and all tests pass, you won't have to PR that much. Only when some other update really breaks a test.
You need 4.4.3 or 4.4.4 Node.js - it was fixed just recently. |
I'd rather put just version 4 or 5 and rely on https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Provided-Node.js-Versions |
And put a warning when testing ssl using uws and a version < 4.4.3 (is this the required minimum for ssl to work ?) |
Apparently other disabled tests are not writing a warning, so i just disabled when node < 4.4.3 and module is uws and test is using https. |
@rauchg I think we are pretty happy with this. Sorry for the extra checks but those are needed because of bugs in Node.js prior to 4.4.3 and we cannot (yet) specify Node.js 4.4.3 in Travis. Thoughts? |
Hi guys, what is the status on this and is there a user level doc? I have an app in production that is working well from a functional standpoint with socket.io(1.7.3) , socket.io-redis (4.0.0), ioredis(3.0.0-0) and node.js 7.7.1. I 'd love to get better performance form uws but need to make sure my app doesn't break and can't afford to rip out socket.io at this point. I have the same (unanswered) question as 'sgrytoyr' on this thread https://news.ycombinator.com/item?id=12905939 @alexhultman related to sending message received on server A to socket on server B . If I just set the env EIO_WS_ENGINE=uws will it work? I don't see uws when I do a find under my app's node_modules. Is there a specific socket.io node.js server version where it has the uws dependency? I 'd happily be a beta test user for this if it helps. |
Engine.io 2.x has uws by default, you could look that up yourself. Nobody can know if it will work or not, you have to test. JavaScript technically has support for enforced encapsulation but no library is really making use of it, instead most libraries "mark variables as private" by putting an underscore infront but since this is not enforced you still can write code that depends on this "private" variable and thus breaks when you swap to uws as it has far different internals. If people would just learn to properly encapsulate their code it would be a different story. |
OK. I messaged @goldfire on his tweet today about successful move of his app to uws (https://twitter.com/GoldFireStudios/status/846340097180098561). He said he did a custom implementation of messaging between servers but suggested one option could be: https://github.com/mmalecki/primus-redis-rooms. Also socket.io 1.7.3 uses engine.io 1.8.3. What version of socket.io will use engine.io 2.x? |
This gives ability to dynamically choose ws implementation, either programmatically or by environment variable, the reason being the availability of the uWebSocket alternative - which will eventually pass the test suite.
That alternative cannot be a definitive replacement for
ws
module because it is an addon,and users need to be able to choose between both solutions.