Skip to content
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

WebSocket permessage-deflate #853

Open
Mixfair opened this issue Jun 18, 2022 · 1 comment
Open

WebSocket permessage-deflate #853

Mixfair opened this issue Jun 18, 2022 · 1 comment

Comments

@Mixfair
Copy link

Mixfair commented Jun 18, 2022

  • Julia 1.7.2
  • HTTP.jl 0.9.17

Hi,

It would be great if HTTP.Websockets could support the permessage-deflate extension, which provides compression for websocket frames. It's described in RFC 7692 and is currently implemented client-side in browsers.

For example, endpoint:

using HTTP

url = "wss://stream.binance.com:9443/stream?streams=adausdt@depth20@100ms/btcusdt@depth20@100ms"
headers = [
   "sec-websocket-extensions" => "permessage-deflate",
]

HTTP.WebSockets.open(url, headers = headers) do ws
   while true
       data = readavailable(ws)
       println(String(data))
   end
end 

I have already implemented this feature locally with CodecZlib. If possible it would be great to see this feature by default

@quinnj
Copy link
Member

quinnj commented Jun 18, 2022

Sigh.....I thought I'd at least get to do the 1.0 release w/ the overhauled WebSockets code that "actually works" before getting a request for this, but that's how it goes sometimes!

Yeah, I don't think this should be too hard to support with the redesigned WebSockets code on HTTP#master. I've been planning to do this as a post-1.0 task however since I it shouldn't involve any breaking changes, so it's easy to add as an enhancement for, e.g., 1.1 release.

@Mixfair, if you'd like to have a go at implementing this, I'd be happy to provide guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants