Akka-http: Support for WebSocket Extensions

Created on 15 Dec 2016  路  10Comments  路  Source: akka/akka-http

Continuation of akka/akka#18709
We currently do not support websocket extensions (i.e. registering "an extension" in the server, or requesting one in the client).

Currently we see no strong need to provide this functionality.
If you have a strong use case for it, please comment here

help wanted 1 - triaged nice-to-have (low-prio) core websocket

Most helpful comment

It's been difficult to track exactly what the state of the art is in Web Sockets compression support, but it seems like most of the major browsers send headers related to compression:
Sec-WebSocket-Extensions: permessage-deflate for Firefox and Chrome
Sec-WebSocket-Extensions: x-webkit-deflate-frame for Safari

It seems like it should be possible for Akka HTTP to take this into account and enable compression when requested.

All 10 comments

One example use case: web socket compression, current draft: https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-28

Nice overview here: https://www.igvita.com/2013/11/27/configuring-and-optimizing-websocket-compression/

Implementing this either requires a way to register such an extension or to implement it internally in Akka HTTP. I think that even if we would implement permessage ourselves it would be nice if it was done through an extension API rather than directly in the blueprints etc.

Note that the original ticket was closed because of lack of interest in it.

Final version of the standard seems to be RFC 7692

One reason it is not completely trivial to implement is that JDK Deflate doesn't support setting window sizes to limit the amount of memory a receiver needs to keep between decompressing chunks.

@jrudolph org.jcraft.jzlib supports setting the window size.

+1 for compression

Compression would be very good for my team's use cases too.

It's been difficult to track exactly what the state of the art is in Web Sockets compression support, but it seems like most of the major browsers send headers related to compression:
Sec-WebSocket-Extensions: permessage-deflate for Firefox and Chrome
Sec-WebSocket-Extensions: x-webkit-deflate-frame for Safari

It seems like it should be possible for Akka HTTP to take this into account and enable compression when requested.

The issue so far remains a low priority for us; if you'd like to give implementing this a shot, that would be very welcome though @acjay :-) Thanks in advance!

+1

+1

Was this page helpful?
0 / 5 - 0 ratings