Skip to content

Releases: cloudwego/volo

Volo-HTTP 0.4.0-rc.5

30 Jun 04:00
ec7f74b

Choose a tag to compare

Volo-HTTP 0.4.0-rc.5 Pre-release
Pre-release

What's Changed

  1. The behavior of using the default version of the HTTP protocol is not appropriate, because all HTTP servers support HTTP/1.1, but not all HTTP servers support HTTP/2, so it is not appropriate to select HTTP/2 by default when both versions are supported. So in this PR, we use HTTP/1.1 by default when "http1" is enabled
  2. There's no HTTP proxy implementation in Volo-HTTP, and when running unit tests using nodes in mainland China, the test fails due to abnormal access to httpbin.org. So we add HttpProxyLayer in Volo-HTTP, it supports HTTP proxy defined in rfc7230 and it can read address from environment variable (http_proxy and HTTP_PROXY) or be set manually.
  3. There are some inappropriate aspects of the previous DNS Resolver implementation, we adjust it in Volo-HTTP and Volo-gRPC which is copied from Volo-HTTP with some modifies.
  4. For better observability, we add SpanProvider for Volo-HTTP, it can enter a user defined span when serving a request.

Pull Request: chore(volo-http): adjust some codes by @yukiiiteru in #590

Full Changelog: volo-http-0.4.0-rc.4...volo-http-0.4.0-rc.5

Volo-HTTP 0.4.0-rc.4

18 Jun 10:52
f4ed063

Choose a tag to compare

Volo-HTTP 0.4.0-rc.4 Pre-release
Pre-release

What's Changed

  • Throw a compile_error if nither feature "http1" nor "http2" is disabled
  • Use only "http1" in default-client and default-server
  • Set default-client and default-server as default features
  • Re-export ClientTransport service for users to import into their inner layers.
  • Use DiscoverKey instead of (FastStr, u16) as Discover::Key
  • 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

Detailed commits

  • fix: Infinite loop printing warn log when discover's watch channel is closed. by @intfish123 in #585
  • chore(volo-http): improve user experience by @yukiiiteru in #587

Full Changelog: volo-http-0.4.0-rc.3...volo-http-0.4.0-rc.4

Volo-HTTP 0.4.0-rc.3

13 Jun 06:30
04eb303

Choose a tag to compare

Volo-HTTP 0.4.0-rc.3 Pre-release
Pre-release

What's Changed

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.

Break Changes

  • Remove default target related functions of ClientBuilder:
    • ClientBuilder::address
    • ClientBuilder::host
    • ClientBuilder::with_port
    • ClientBuilder::with_scheme
    • ClientBuilder::target_ref
    • ClientBuilder::target_mut
  • Refactor Host layer, and ClientBuilder::default_host is updated to ClientBuilder::host_mode
  • Remove RequestBuilder::full_uri

Related Commits

  • chore(volo-http): fix clippy warning mismatched_lifetime_syntaxes by @yukiiiteru in #576
  • chore(volo-http): refactor target logics of http client by @yukiiiteru in #580

Full Changelog: volo-http-0.4.0-rc.2...volo-http-0.4.0-rc.3

Volo 0.10.7

29 May 07:26
dcbdcd2

Choose a tag to compare

What's Changed

In this version, Volo adds support for ALPN of TLS through:

Volo-HTTP 0.4.0-rc.2

29 May 07:27
dcbdcd2

Choose a tag to compare

Volo-HTTP 0.4.0-rc.2 Pre-release
Pre-release

What's Changed

Volo-HTTP supports HTTP/2 for both server and client, and connection pool for client is also supported.

Detailed commits

  • feat(volo-http): support http/2 for server by @yukiiiteru in #573
  • feat(volo-http): support http2 and connection pool for client by @yukiiiteru in #574

Full Changelog: volo-http-0.4.0-rc.1...volo-http-0.4.0-rc.2

Volo-HTTP 0.4.0-rc.1

27 May 10:25
be8eccb

Choose a tag to compare

Volo-HTTP 0.4.0-rc.1 Pre-release
Pre-release

What's Changed

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.

Break Changes

  • 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.

Others

This PR adds a debugging layer for unit tests. It will dump request and response via println, and if any unit test fails, cargo will print its output by default.

Detailed commits

New Contributors

Full Changelog: volo-http-0.3.1...volo-http-0.4.0-rc.1

Volo-Thrift 0.10.7

17 Feb 13:40
0b5d6be

Choose a tag to compare

What's Changed

  • feat: don't log broken pipe error on server by default by @PureWhiteWu in #548

Full Changelog: volo-thrift-0.10.6...volo-thrift-0.10.7

Volo 0.10.5

17 Feb 13:40
0b5d6be

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: volo-0.10.3...volo-0.10.5

volo-thrift-0.10.6

10 Feb 12:23
5a6018b

Choose a tag to compare

What's Changed

  • chore(volo-thrift): fix clippy warning needless_as_bytes by @yukiiiteru in #529
  • fix(volo-thrift): clean waiters while failed waiting for idle connection by @Millione in #547

Full Changelog: volo-thrift-0.10.5...volo-thrift-0.10.6

Volo-HTTP 0.3.0

28 Nov 12:38
661346b

Choose a tag to compare

What's Changed

Notable Changes

Since Volo-HTTP 0.2.14

  • Server side
    • Support MultiPart #511
  • Client Side
    • Use less Result in client #509
    • Support CookieJar #512
    • Refactor ClientBuilder, Target and CallOpt #528
  • Generic
    • Wrap hyper::body::Incoming by Body #504

Bugfix

  • Fixed the issue where the Form was rejected due to incorrect judgment #538
  • Fixed an issue where DNS resolution would always prefer IPv4 addresses #538

Break Changes

Adjust positions of some mods #499

Because the positions of the modules were confusing before, we adjusted the positions of some modules for a better user experience.

  • volo_http::json::Json -> volo_http::server::extract::Json
  • volo_http::extension::Extension -> volo_http::utils::Extension
  • volo_http::cookie::CookieJar -> volo_http::utils::cookie::CookieJar

In addition, Json and Extension were not be re-exported in volo_http, user should import them by its full path.

All Bodys (http_body::Body) are unified into volo_http::body::Body #504

For a more unified experience, we wrap hyper::body::Incoming by volo_http::body::Body, and default generic types of Router, MethodRouter, Route and FromRequest have been updated from Incoming to Body.

And because Body is unified, ClientRequest and ServerRequest are unified into Request, and ClientResponse and ServerResponse are unified into Response. Currently XxxRequest and XxxResponse are not removed, but marked as deprecated.

If you are using Router (and MethodRouter, Route) and specify Incoming as its generic type, update it to Body or remove the generic type directly.

If you implemented FromRequest without use generic type (use default generic type), the argument type should be updated.

If you used ServerRequest and ClientRequest, replace it to Request. If you used ServerResponse and ClientResponse, replace it to Response.

// old
let _: Router<Incoming> = Router::new().route(...);

// new
let _: Router<Body> = Router::new().route(...);
// or remove generic type
let _: Router = Router::new().route(...);
// old
impl FromRequest for Foo {
    type Rejection = ...;
    async fn from_request(
        cx: &mut ServerContext,
        parts: Parts,
        body: Incoming,
    ) -> Result<Self, Self::Rejection> {
    }
}

// new
impl FromRequest for Foo {
    type Rejection = ...;
    async fn from_request(
        cx: &mut ServerContext,
        parts: Parts,
        body: Body,
    ) -> Result<Self, Self::Rejection> {
    }
}

// or use generic type B
impl<B> FromRequest<B> for Foo
where
    B: Body + Send,
    B::Data: Send,
    B::Error: Send,
{
    type Rejection = ...;
    async fn from_request(
        cx: &mut ServerContext,
        parts: Parts,
        body: B,
    ) -> Result<Self, Self::Rejection> {
    }
}

Most client methods no longer return Result #509

For a better user experience, we changed the return value of some methods of client that originally returned Result<Self> to Self.

In other words, chain calls can be used fluently without adding unwrap, expect or ? in between, they can be removed.

// old
let _ = client.get("http://example.com/").unwrap().send().await;

// new
let _ = client.get("http://example.com/").send().await;

Refactor ClientBuilder, Target and CallOpt #522 #528

In order to make the service function more independent, and unify the user experience of Volo-Thrift, Volo-gRPC and Volo-HTTP, while retaining the characteristics of Volo-HTTP, we refactored ClientBuilder, Target and CallOpt.

  • ClientBuilder::caller_name and ClientBuilder::callee_name are renamed to ClientBuilder::user_agent and ClientBuilder::default_host
  • ClientBuilder::fail_on_status has been removed, you should use FailOnStatus layer instead
  • RequestBuilder::set_request_timeout has been removed, users should use RequestBuilder::with_callopt and CallOpt::new().with_timeout(...) instead
// old
let mut builder= ClientBuilder::new();
builder.caller_name(...).callee_name(...).fail_on_status(...);
let client = builder.build();
client.get(...).set_request_timeout(...).send().await;

// new
let mut builder= ClientBuilder::new();
builder.user_agent(...).default_host(...).layer_outer(FailOnStatus::xxx());
let client = builder.build();
client.get(...).with_callopt(CallOpt::new().with_timeout(...)).send().await;

And if you are using customized service discover, you should also pay attention to the following changes:

  • TargetParser has been removed, you should implement volo::client::Apply for your service discover

Detailed Pull Requests

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