github cloudwego/volo volo-http-0.4.0
Volo-HTTP 0.4.0

latest releases: volo-thrift-0.11.2, volo-0.11.1, volo-thrift-0.11.1...
2 months ago

What's Changed

Since Volo-HTTP 0.3.0

Features

Simplify Client

In the previous implementation, for the sake of performance, we used a lot of generics in the Client and minimized the use of Box. However, we found that this would make the Client too complicated and the Client-related errors difficult to understand.

To avoid the Client type being too complicated, we used Box in the outermost layer to wrap the inner dyn Future, which would not have a high performance overhead while ensuring that the type is simple and easy to use.

In 0.3.0, we may build a client typed DefaultClient with complicated generic types (and all of them are complicated type aliases), and in 0.4.0, we can use Client directly.

Support HTTP/2

We support HTTP/2 for both server and client, and connection pool for client is also supported.

Other Changes

Remove default Target of Client

Considering that default Target of Client is used less frequently, but it makes Target selection logic of Client too complicated, we have removed default Target of Client in this version.

However, we have added TargetLayer, it can force Client to set a Target, which can provide a similar experience as before.

With the removal of default Target of Client, configuration of default Host is also removed. Here we adjust the original Host Layer to be more flexible, which can be set to None, Auto, Force, Fallback modes.

The default callee name has been removed in favor of the with_callee_name method of TargetLayer. This is only necessary when accessing an HTTPS address via an IP address and needing to set up SNI.

Additionally, RequestBuilder::full_uri has been removed. We recommend using a Layer to implement this functionality rather than in RequestBuilder, and an example will be pushed later.

Others

  • Rename DefaultLB and DefaultLBService to DefaultLb and DefaultLbService
  • Remove deprecated ClientRequest, ServerRequest, ClientResponse, ServerResponse
  • Reduce some generic constraints
  • Fix infinite loop printing warn log when discover's watch channel is closed
  • Add HttpProxyLayer for supporting RFC7230 defined HTTP proxy
  • Support SpanProvider for HTTP server

Bug Fix

  • Use DiscoverKey instead of (FastStr, u16) as Discover::Key to avoid discovering unexpected cache of domain name with port

Break Changes

Simplify Client

  • The complex type aliases have been removed, including:
    • ClientMetaService
    • ClientService
    • SimpleClient
    • DefaultClientOuterService
    • DefaultClient
  • Generic types of Client has been changed from inner service (S) to request body and response body (ReqBody and RespBody).
    • In most cases, users can use Client directly and ignore the generic types.

Support HTTP/2

  • Since HTTP/2 is supported in this version, we add new features "http1" and "http2"
  • Default features is updated to ["default-client", "default-server"]

Additionally, the "default-client" and "default-server" use HTTP/1 only

Remove default Target of Client

  • Default target related functions of ClientBuilder are removed:
    • ClientBuilder::address
    • ClientBuilder::host
    • ClientBuilder::with_port
    • ClientBuilder::with_scheme
    • ClientBuilder::target_ref
    • ClientBuilder::target_mut
  • Host layer is refactored, and ClientBuilder::default_host is updated to ClientBuilder::host_mode
  • RequestBuilder::full_uri is removed

Detailed Commits

New Contributors

Full Changelog: volo-http-0.3.0...volo-http-0.4.0

Don't miss a new volo release

NewReleases is sending notifications on new releases.