Skip to content

Conversation

@keelerm84
Copy link
Member

Introduce a generic HttpTransport trait to decouple the SDK from specific HTTP client implementations. This follows the pattern established in eventsource-client.

  • Add transport.rs with HttpTransport trait and error types
  • Add transport_hyper.rs with hyper 1.0 implementation
  • Make hyper an optional dependency via feature flags
  • Use Bytes for request bodies (supports binary and empty)
  • Stream response bodies via ByteStream type alias

This commit adds the abstraction without changing existing code.

Introduce a generic HttpTransport trait to decouple the SDK from
specific HTTP client implementations. This follows the pattern
established in eventsource-client.

- Add transport.rs with HttpTransport trait and error types
- Add transport_hyper.rs with hyper 1.0 implementation
- Make hyper an optional dependency via feature flags
- Use Bytes for request bodies (supports binary and empty)
- Stream response bodies via ByteStream type alias

This commit adds the abstraction without changing existing code.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@keelerm84 keelerm84 requested a review from a team as a code owner January 12, 2026 20:53
default = ["rustls"]
rustls = ["hyper-rustls", "launchdarkly-server-sdk/rustls"]
default = ["hyper-rustls"]
hyper-rustls = ["dep:hyper-rustls", "launchdarkly-server-sdk/hyper-rustls"]
Copy link
Member

Choose a reason for hiding this comment

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

Is changing this feature name going to be a problem compatibility wise?

Copy link
Member

Choose a reason for hiding this comment

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

Or was this a new feature to the branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is getting merged into a separate branch that will become 3.x once the rest of the stuff is done. So I expect to break backwards compatibility with this.

Copy link
Member

Choose a reason for hiding this comment

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

I assume this is basically the same as the event source one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep.

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.

3 participants