-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Supported WebSocket implementations #1195
Comments
Well, if you are wondering about integration into jsdom, my vote would go to one that:
|
In particular, I'm a little unclear what the purpose of this question is. Are you preparing to create a PR to add web socket support to jsdom? |
I'd create a PR to add websocket support if you'd want it. For code that I'm testing using JSDom, I also want to be able to test websockets (while being able to browserify the whole lot). |
That would be lovely! |
Would it be appropriate to use |
Definitely. |
@avesus It turns out a lot of people find purpose in it so far despite it not being a complete browser.
What PR? |
I never made a PR, ended up getting away from jsdom for a bit as well as the project I wanted websockets for. Back to using it again though! |
Please use the voting buttons and don't add "me too" comments. Deleting the one that just appeared. |
Voting buttons? I'm looking around for this, found a change petition but it appears that github has not implemented any voting system.. |
@inikulin thanks. I was not aware that in github land that reaction.meaning == vote.meaning (or that you could use reactions as a voting mechanism). Sorry about my lack of proper github social skills. |
Hey it's ok, the feature has only been around a few weeks IIRC. |
what is the current state of websocket in jsdom? |
It's not implemented. |
@Sebmaster Do you plan to implement websokets in near future? |
I don't think anyone of us is currently implementing it, or prioritizing it in the near future. So unless there's a PR or a change of priorities, probably not. |
Is anyone interested in collaborating on this? I'm willing to do the work but would be great to have others participate at least in reviews. |
@palmerj3 I'd be interested, but I'm sure the rest of @jsdom would be too. Just make sure to look at the requirements @Joris-van-der-Wel listed out when choosing a WS library: #1195 (comment). If you hit any bumps, we'll be on #jsdom at Freenode to help :) |
Is anyone working on this? Will take a crack at it otherwise |
No one is working on this. |
In general we're not able to use any modules directly as they don't support the full Web IDL semantics; wrapping will still be necessary. See https://github.com/tmpvar/jsdom/blob/master/Contributing.md#architecture for more information. |
Would using this not work? https://www.npmjs.com/package/universal-websocket-client This is actually what I'm using in my application that jsdom is having issues with |
That definitely wouldn't be a good idea; it's just a wrapper around |
AFAIK this wrapper does implement this spec API |
Yes, but as I tried to explain (and Contributing.md goes into in more detail), it doesn't implement it in a way that's compatible with jsdom's systems. For example, jsdom already contains an EventTarget, so we can't use the one that ws (or universal-websocket-client) comes with; then we'd have duplicates. |
Ah that makes sense. Will dig into the contributing docs. Thanks |
FYI there is now an active PR implementing the entirety of the WebSocket APIs, in #2088. Please, check it out! |
The WebSocket API PR just got merged! Support will be available in the next jsdom release. |
There's code we want to be able to test with JSDom that uses websockets. There are a lot of different implementations. Which would you suggest for use in contexts server side in JSDom + client side in the browser? I'm leaning towards ws.
The text was updated successfully, but these errors were encountered: