Skip to content

feat: Example of configuring HTTP/2 via SDK HttpConfiguration#21

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772495240-http2-example
Draft

feat: Example of configuring HTTP/2 via SDK HttpConfiguration#21
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1772495240-http2-example

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Mar 2, 2026

Summary

Demonstrates how to force HTTP/2 on all LaunchDarkly SDK traffic using the SDK's HttpConfigurationBuilder.MessageHandler() API. This is intended as a reference branch that can be shared with customers who need HTTP/2 support.

The approach uses a DelegatingHandler (Http2Handler) that wraps a SocketsHttpHandler and sets request.Version = HttpVersion.Version20 on every outgoing request. This handler is then passed to the SDK configuration via Components.HttpConfiguration().MessageHandler(handler).

Tested successfully against LaunchDarkly — SDK initializes and streams data with this configuration.

Review & Testing Checklist for Human

  • Custom MessageHandler bypasses SDK defaults: When providing a custom MessageHandler, the SDK's built-in ConnectTimeout and Proxy configuration on its internal SocketsHttpHandler is bypassed. Verify this tradeoff is acceptable for the customer's use case, or consider adding a comment noting they should configure the SocketsHttpHandler themselves if they need those features.
  • Long-lived streaming over HTTP/2: The automated test used CI=true which exits after init. Manually run without CI=true and confirm the SSE streaming connection remains stable over HTTP/2 for several minutes.
  • No secrets in diff: Confirmed clean, but double-check no credentials leaked.

Recommended test plan: Run LAUNCHDARKLY_SDK_KEY=<key> dotnet run --project HelloDotNet/HelloDotNet.csproj and verify the SDK initializes, evaluates flags, and receives streaming updates over time.

Notes


Open with Devin

Demonstrates how to use a DelegatingHandler with the SDK's
HttpConfigurationBuilder.MessageHandler() to set the HTTP version
to 2.0 on all outgoing SDK requests.

Co-Authored-By: rlamb@launchdarkly.com <rlamb@launchdarkly.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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

Successfully merging this pull request may close these issues.

0 participants