ChilliCream / ChilliCream/graphql-platform

Websocket per message deflate

Open
#7,752 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Subscriptions
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

Hi everyone, is there any way to compress messages when using websockets on Hotchocolate defining like here: https://www.rfc-editor.org/rfc/rfc7692 ? smth: per message deflate

The solution you'd like

As far as I saw from codes, HotChocolate.AspNetCore.Subscriptions.WebSocketConnection.cs creates the websocket connection on TryAcceptConnection method. using var socket = await webSocketManager.AcceptWebSocketAsync(); with this code. Can we have a chance to give WebSocketAcceptContext while AcceptWebSocketAsync which I send you attached picture. DangerousEnableCompression will do the permessagedeflate operation if given true, thx in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in HotChocolate.AspNetCore.Subscriptions.WebSocketConnection.cs, at TryAcceptConnection and its call to AcceptWebSocketAsync. Read the RFC 7692 reference and the WebSocketAcceptContext API to understand how DangerousEnableCompression is passed. Done means the WebSocket subscription connection can negotiate per-message deflate through the requested accept context.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.