-
-
Notifications
You must be signed in to change notification settings - Fork 756
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-driven option to enable websocket binary write #1338
Comments
This is fairly simple to do right now with today's 2.1.0-SNAPSHOT. Just do:
if (webSocket.resource().getRequest().getHeader('supportBinary') ... ) {
webSocket.binaryWrite(true).write(...); or when the if (webSocket.resource().getRequest().getHeader('supportBinary') ... ){
webSocket.binaryWrite(true);
} Let me know if that works and I can add official support client side. |
In fact, I don't think that is the most convenient way, could we have a defined header name to use (and implement this logic under the hood). That instead of creating an additional websocket handler to just hook into onOpen event seems just easier for the lazy geeks like me :D |
Ok added `AtmosphereResource.forceBinaryWrite' API. |
Fixed and documented |
Would be great to have a per request attribute based switch to enable binary write onto this connection. A similar pattern is used with TrackMessageLength attribute.
Global attribute switch is a bit too wide a scope as some browser support websocket but don't support arraybuffer or blob (IE comes to mind). If the client can present a flag simply populated by "supportBinary:!!window.ArrayBuffer" or similar then the server could write bytes.
That would complete a story to easily enable byte streaming (mainly used for media frames) from server to client.
To fix client to server stream, this Atmosphere/atmosphere-javascript#38 should be just enough (combined with a Streaming Websocket handler).
The text was updated successfully, but these errors were encountered: