422 Commits

Author SHA1 Message Date
Eliza Weisman
abb6471690 refactor(client): use tokio's TcpSocket for more sockopts (#2335)
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-11-18 14:45:45 -08:00
Sean McArthur
bdb5e5d694 feat(server): Make the server code an optional feature (#2334)
cc #2223 

BREAKING CHANGE: The HTTP server code is now an optional feature. To
  enable the server, add `features = ["server"]` to the dependency in
  your `Cargo.toml`.
2020-11-18 11:02:20 -08:00
Sean McArthur
4e55583d30 feat(client): Make client an optional feature
cc #2223

BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To
  enable the client, add `features = ["client"]` to the dependency in
  your `Cargo.toml`.
2020-11-17 17:06:25 -08:00
Sean McArthur
2a19ab74ed feat(http1): Make HTTP/1 support an optional feature
cc #2251

BREAKING CHANGE: This puts all HTTP/1 methods and support behind an
  `http1` cargo feature, which will not be enabled by default. To use
  HTTP/1, add `features = ["http1"]` to the hyper dependency in your
  `Cargo.toml`.
2020-11-17 10:42:20 -08:00
Sean McArthur
b819b428d3 feat(http2): Make HTTP/2 support an optional feature
cc #2251

BREAKING CHANGE: This puts all HTTP/2 methods and support behind an
  `http2` cargo feature, which will not be enabled by default. To use
  HTTP/2, add `features = ["http2"]` to the hyper dependency in your
  `Cargo.toml`.
2020-11-10 13:40:34 -08:00
Sean McArthur
1b9af22fa0 Tokio 0.3 Upgrade (#2319)
Co-authored-by: Urhengulas <johann.hemmann@code.berlin>
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2020-11-05 17:17:21 -08:00
Sean McArthur
cc7d3058e8 chore(lib): start 0.14.x development 2020-11-02 16:17:15 -08:00
Sean McArthur
42560c7c40 v0.13.9 2020-11-02 15:20:53 -08:00
Ivan Nikulin
fb19f3a869 feat(client): add HttpConnector::set_local_addresses to set both IPv6 and IPv4 local addrs (#2172)
Currently HttpConnector::set_local_address method accepts a single
argument. Server might not support IPv6 or IPv4. Therefore, the only
solution at the moment is to manually perform DNS resolution and pick
appropriate local address family. This is inefficient, as leads to
2 DNS lookups per request. This commit allows specifying both IPv4
and IPv6, so connector can decide which one to use based on DNS
resolution results.
2020-10-13 16:02:16 -07:00
Taiki Endo
02732bef0c chore(dependencies): update pin-project to 1.0 (#2298) 2020-10-13 11:14:47 -07:00
Sean McArthur
523d66a41f refactor(body): fix unused sync_wrapper when stream feature disabled (#2287) 2020-09-21 13:57:58 -07:00
Sean McArthur
aea9c52808 v0.13.8 2020-09-18 10:44:16 -07:00
Sean McArthur
25a05894b9 refactor(h1): use httpdate for server date header 2020-07-28 17:48:32 -07:00
JohnMartin95
f4f14b30e3 chore(dependencies): require tokio 0.2.11 (#2252)
Closes #2250
2020-07-28 16:49:09 -07:00
Sean McArthur
4216b2de70 v0.13.7 2020-07-13 17:03:48 -07:00
David Barsky
9832aef9ee feat(lib): Move from log to tracing in a backwards-compatible way (#2204)
I've moved Hyper from `log` to `tracing`. Existing `log`-based users shouldn't notice a difference, but `tracing` users will see higher performance when filtering data. This isn't the _end_  of the `tracing` integration that can happen in `Hyper` (e.g., Hyper can start using spans, typed fields, etc.), but _something_ is better than nothing. I'd rather address those points, including examples, in followups.

I've attached a screenshot of the `hello` example working, but the logged information is pulled from `tracing`, not `log`.

<img width="514" alt="Screen Shot 2020-05-16 at 1 23 19 PM" src="https://user-images.githubusercontent.com/2067774/82126298-d8103800-9779-11ea-8f0b-57c632c684d6.png">
2020-07-06 18:30:41 -07:00
Taiki Endo
9998f0fd0b refactor(lib): remove pin related unsafe code (#2220) 2020-06-08 16:02:14 -07:00
Taiki Endo
d5d09ed753 refactor(lib): Remove uses of pin_project::project attribute (#2219)
pin-project will deprecate the project attribute due to some unfixable
limitations.

Refs: https://github.com/taiki-e/pin-project/issues/225
2020-06-05 16:53:58 -07:00
Sean McArthur
b6fb18aee0 v0.13.6 2020-05-29 11:55:20 -07:00
Joshua Nelson
d5b0ee5672 refactor(client): switch from net2 to socket2 (#2206)
net2 was recently deprecated; socket2 is the recommended alternative

Closes #2205
2020-05-18 17:19:38 -07:00
Nikolai Kuklin
203621e3be feat(example): read file by chunks in send_file example (#2193) 2020-04-24 13:02:58 -07:00
Bastien Orivel
e08a271eb9 chore(dependencies): Force tokio to be at least 0.2.5 (#2186)
Without this, you can end up with tokio 0.2.4 and hyper 0.13.5 in your
project, leading to a compile error like this:

```
error[E0599]: no method named `try_recv` found for struct `tokio::sync::mpsc::unbounded::UnboundedReceiver<client::dispatch::Envelope<T, U>>` in the current scope
   --> src/client/dispatch.rs:161:26
    |
161 |         match self.inner.try_recv() {
    |                          ^^^^^^^^ method not found in `tokio::sync::mpsc::unbounded::UnboundedReceiver<client::dispatch::Envelope<T, U>>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `hyper`.
```
2020-04-18 08:18:28 -07:00
Sean McArthur
ffb759701c v0.13.5 2020-04-17 12:29:50 -07:00
Sean McArthur
22fcd66241 v0.13.4 2020-03-20 16:13:44 -07:00
Sean McArthur
5b046a1f8f v0.13.3 2020-03-03 15:34:49 -08:00
Sean McArthur
6a1bd055fc refactor(http2): store bdp sampler in Body H2 variant 2020-03-03 14:48:42 -08:00
Sean McArthur
141207769f v0.13.2 2020-01-29 12:41:58 -08:00
Sean McArthur
2983395d63 chore(lib): update pretty_env_logger to v0.4 (#2123) 2020-01-29 12:08:43 -08:00
Sean McArthur
5c6536317c docs(examples): improve README for examples directory 2020-01-29 11:09:21 -08:00
Sean McArthur
ba2a144f8b fix(client): strip path from Uri before calling Connector (#2109) 2020-01-13 11:45:28 -08:00
Sean McArthur
61b62eeac8 v0.13.1 2019-12-16 11:44:04 -08:00
Sean McArthur
4b6099c7aa feat(body): implement HttpBody for Request and Response
When the body type of a `Request` or `Response` implements `HttpBody`,
the `Request` or `Response` itself now implements `HttpBody`.

This allows writing things like `hyper::body::aggregate(req)` instead of
`hyper::body::aggregate(req.into_body())`.

Closes #2067
2019-12-13 10:48:30 -08:00
Euclidr
bfda390617 docs(server): http_proxy example 2019-12-12 16:59:38 -08:00
Sean McArthur
070c84ec43 v0.13.0 2019-12-10 09:45:42 -08:00
Sean McArthur
245fa9c44c refactor(server): remove Unpin requirement from the Body generic 2019-12-06 13:27:08 -08:00
Sean McArthur
8ba9a8d2c4 feat(body): add body::aggregate and body::to_bytes functions
Adds utility functions to `hyper::body` to help asynchronously
collecting all the buffers of some `HttpBody` into one.

- `aggregate` will collect all into an `impl Buf` without copying the
  contents. This is ideal if you don't need a contiguous buffer.
- `to_bytes` will copy all the data into a single contiguous `Bytes`
  buffer.
2019-12-06 10:03:05 -08:00
Sean McArthur
b0060f277e chore(CI): enable GitHub Actions 2019-12-05 13:12:35 -08:00
Sean McArthur
0b03b73053 feat(lib): rename unstable-stream feature to stream and enable by default
Closes #2034
2019-12-04 17:09:10 -08:00
Sean McArthur
a738d03fd3 chore(dependencies): update to http-body 0.3 2019-12-04 16:48:06 -08:00
David Barsky
19a7aab51f chore(dependencies): update tower-service to 0.3 2019-12-04 12:13:14 -08:00
Sean McArthur
6ae5889f83 feat(rt): introduce rt::Executor trait
The `hyper::rt::Executor` trait allows defining custom executors to be
used with hyper's `Client` and `Server`.

Closes #1944

BREAKING CHANGE: Any type passed to the `executor` builder methods must
  now implement `hyper::rt::Executor`.

  `hyper::rt::spawn` usage should be replaced with `tokio::task::spawn`.

  `hyper::rt::run` usage should be replaced with `#[tokio::main]` or
  managing a `tokio::runtime::Runtime` manually.
2019-12-04 11:38:23 -08:00
Sean McArthur
cb3f39c2dc feat(lib): update Tokio, bytes, http, h2, and http-body 2019-12-04 10:56:34 -08:00
Daniel Johnson
71d088d3d0 chore(dependencies): update futures to 0.3.1 2019-11-14 10:04:16 -08:00
Sean McArthur
8b878a805a perf(client): change HttpConnecting to hold Arc<Config> instead of inlined fields 2019-10-23 16:21:51 -07:00
Sean McArthur
4f2743991c feat(service): rename Service to HttpService, re-export tower::Service`
The only important trait for a user is the `tower::Service` trait, which
is now available also at `hyper::service::Service`. The other "trait
aliases" are no longer publicly exported, as people thought they had to
implement them.

Also removes dependency on `tower-make`, which is trivial but otherwise
shouldn't affect anyone.

Closes #1959
2019-10-21 11:01:28 -07:00
Sean McArthur
2d6bbd2cd8 chore(ci): re-enable CI running on beta 2019-10-18 15:16:07 -07:00
Ben Boeckel
536b1e184e fix(dependencies): require correct bytes minimum version (#1975)
`Bytes::advance` was introduced in this version.
2019-10-14 11:28:41 -07:00
Sean McArthur
0ef12a11a8 v0.13.0-alpha.4 2019-10-01 11:43:38 -07:00
Sean McArthur
64fe70b2f9 chore(dependencies): update http-body to alpha.3 2019-10-01 11:39:57 -07:00
Sean McArthur
353be888fa v0.13.0-alpha.3 2019-10-01 10:28:13 -07:00