aio-libs / aiohttp

Asynchronous HTTP client/server framework for asyncio and Python
https://docs.aiohttp.org
Other
15.17k stars 2.02k forks source link

Support for WebSocket extension `permessage-gzip` #9933

Open jakob-keller opened 6 days ago

jakob-keller commented 6 days ago

Is your feature request related to a problem?

I cannot communicate with WebSocket servers that use the permessage-gzip extension.

Describe the solution you'd like

aiohttp should provide support for the WebSocket extension permessage-gzip.

Describe alternatives you've considered

I was unable to find any alternative Python WebSocket libraries that provide support for the permessage-gzip extension.

Related component

Client

Additional context

RFC 7692 [...] defines a framework for creating WebSocket extensions that add compression functionality to the WebSocket Protocol [...] and specifies one specific compression extension using the DEFLATE algorithm.

2273 added initial support for RFC 7692 including the permessage-deflate extension.

Code of Conduct

Dreamsorcerer commented 6 days ago

Searching "permessage-gzip" got me exactly 1 result, so this doesn't look like something that people are generally using. But, I think the standard that defines this support is (as listed above) https://www.rfc-editor.org/rfc/rfc7692.html So, if someone wants to implement it, we can take a look at supporting it.

jakob-keller commented 6 days ago

Searching "permessage-gzip" got me exactly 1 result, so this doesn't look like something that people are generally using.

You are right. The server I need to talk to is part of a private preview API. I will ask the provider to consider changing the compression to permessage-deflate or making it optional.

But, I think the standard that defines this support is (as listed above) https://www.rfc-editor.org/rfc/rfc7692.html So, if someone wants to implement it, we can take a look at supporting it.

If the provider does not move away from permessage-gzip, I might be able to contribute to a PR at a later time.