ChilliCream / ChilliCream/graphql-platform
Support setting `ClientWebSocketOptions` using sockets client builder
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Strawberry Shake
Is your feature request related to a problem?
I was interested in customizing the options for the .NET web socket used by the transport.
The WebSocketClient wrapper exposes the underlying socket so that you can access it from the sockets client builder, however it does so as a WebSocket instead of the subtype ClientWebSocket, which does not expose the Options.
The solution you'd like
If we could change the type of IWebSocketClient.Socket to ClientWebSocket, I would be able to customize these settings using the client builder:
builder.Services
.AddConferenceClient()
.ConfigureWebSocketClient(
client =>
{
client.Uri = new Uri("ws://localhost:5050/graphql");
client.Options.KeepAliveInterval = TimeSpan.FromSeconds(5);
});
I realize this is technically a breaking change (if a consumer of your library has implemented this interface), and there is an easy workaround of casting. Perhaps something to include in the next major version bump?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with IWebSocketClient.cs and WebSocketClient.cs to trace the Socket type exposed to WebSocketClientBuilderExtensions.cs. Check how the builder configures the exposed socket and review the compatibility implications for interface consumers. Done means the builder can configure ClientWebSocket.Options as requested without breaking the transport.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100