chore: upgrade hyper/tokio libraries
This commit is contained in:
parent
ff09ac01a1
commit
f8cd92c507
@ -19,9 +19,9 @@ include = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hyper = "0.13"
|
hyper = { version = "0.14", features = ["full"] }
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
unicase = "2.6"
|
unicase = "2.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { version = "0.2", features = ["full"] }
|
tokio = { version = "0.3", features = ["full"] }
|
||||||
|
@ -25,8 +25,8 @@ Add these dependencies to your `Cargo.toml` file.
|
|||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hyper-reverse-proxy = "0.5"
|
hyper-reverse-proxy = "0.5"
|
||||||
hyper = "0.13"
|
hyper = { version = "0.14", features = ["full"] }
|
||||||
tokio = { version = "0.2", features = ["full"] }
|
tokio = { version = "0.3", features = ["full"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
The following example will set up a reverse proxy listening on `127.0.0.1:13900`,
|
The following example will set up a reverse proxy listening on `127.0.0.1:13900`,
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
//! // will forward requests to port 13902
|
//! // will forward requests to port 13902
|
||||||
//! match hyper_reverse_proxy::call(client_ip, "http://127.0.0.1:13902", req).await {
|
//! match hyper_reverse_proxy::call(client_ip, "http://127.0.0.1:13902", req).await {
|
||||||
//! Ok(response) => {Ok(response)}
|
//! Ok(response) => {Ok(response)}
|
||||||
//! Err(error) => {Ok(Response::builder()
|
//! Err(_error) => {Ok(Response::builder()
|
||||||
//! .status(StatusCode::INTERNAL_SERVER_ERROR)
|
//! .status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||||
//! .body(Body::empty())
|
//! .body(Body::empty())
|
||||||
//! .unwrap())}
|
//! .unwrap())}
|
||||||
@ -83,11 +83,10 @@
|
|||||||
//!
|
//!
|
||||||
//! let server = Server::bind(&addr).serve(make_svc);
|
//! let server = Server::bind(&addr).serve(make_svc);
|
||||||
//!
|
//!
|
||||||
|
//! println!("Running server on {:?}", addr);
|
||||||
//! if let Err(e) = server.await {
|
//! if let Err(e) = server.await {
|
||||||
//! eprintln!("server error: {}", e);
|
//! eprintln!("server error: {}", e);
|
||||||
//! }
|
//! }
|
||||||
//!
|
|
||||||
//! println!("Running server on {:?}", addr);
|
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
Loading…
Reference in New Issue
Block a user