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
Client feature request: add WebSocket support #69
Comments
I'd love to add websocket clent support too. I've try it, the only thing that prevent me from doing is: I can not think of a Good enough API. Can you please help by providing the ideal way you want to use http-kit. |
I'm looking for something similar as well, however websockets have pretty poor cross-browser support right now. https://github.com/sockjs/sockjs-client seems to be a good solution for streaming and push-based services that need cross-browser support, but the only JVM-compatible server implementation of the protocol is vertx. It would be really neat if there was a sockjs implementation built off of http-kit, and even nicer if core.async could be utilized. |
@shenfeng I'm not sure what an ideal interface would be, but at a minimum it could like like a combination of normal browser API (http://www.w3.org/TR/2011/WD-websockets-20110929/#handler-websocket-onopen) and clj-http request API. Something like this:
It might also be useful if the returned object had additional protocols that allow runtime settings to be queried (readyState, bufferedAmount) and changed (on-open, on-close, on-receive, etc). |
👍 for @kanaka 's interface suggestion. Might also pass in the |
hi @shenfeng |
James Henderson has a solution that wraps http-kit websocket communication in core.async channels. As far as an API semantics goes, I don't think we're going to get anything better than channels to describe communication over, indeed, a channel. However, as previously pointed out, browser support remains remains a question mark. Supported from IE 10 and not supported on Android at all? |
@eneroth Modern versions of Android default to Chrome for Android which has WebSocket support. Older versions of IE (6-9) and some Android installs can support WebSockets using the web-socket-js Flash shim. You don't get binary data support with the shim, but those platforms don't have binary data (typed arrays and blobs) anyways. That means the supported marketshare for basic WebSocket support is actually quite high. |
@eneroth if you are already dealing with fressian data in browsers that don't have native binary types, then that means you have some sort of way of representing/storing it in those browser's existing data types (binary coded string, regular array of bytes, etc). You may just need to base64 encode what you already have and then base64 decode on the other end. You would lose some of the efficiency of fressian, but it might be enough for what you are trying to do. |
What is the current state of this? :-) |
Hi, I'am not sure the time schedule for http-kit has support for websocket client. There is another one that's maybe useful: https://github.com/neotyk/http.async.client |
I understand you want to (1) get the right API rather than (2) release something hacky and ahve to change the API later. Thanks for the references! |
Ref. #101 for API discussion |
Hey, this feature request has no updates since 2015 - just wondering what the current state of websocket client support is. Is it implemented and just not documented yet? |
Hi @TRManderson, unfortunately no updates since last updates on this thread. |
It would be nice to be able to use one library for both WebSocket servers and clients. It looks like currently only creating WebSocket servers is supported by http-kit.
The text was updated successfully, but these errors were encountered: