Replace Hyper with Warp for HTTP server

- Use Warp
- Optimize clones
- HTTPS server
- Content-Length limit
- HTTP Basic Auth
- Stop server with Ctrl-C
This commit is contained in:
Adrián Arroyo Calle
2023-09-05 20:40:58 +02:00
parent 841aaa78b4
commit 660860bccf
9 changed files with 682 additions and 339 deletions

View File

@@ -21,7 +21,7 @@ ffi = ["dep:libffi"]
repl = ["dep:crossterm", "dep:ctrlc", "dep:rustyline"]
hostname = ["dep:hostname"]
tls = ["dep:native-tls"]
http = ["dep:hyper", "dep:reqwest"]
http = ["dep:warp", "dep:reqwest"]
rust_beta_channel = []
crypto-full = []
@@ -66,7 +66,6 @@ ryu = "1.0.9"
futures = "0.3"
libloading = "0.7"
derive_deref = "1.1.1"
http-body-util = "0.1.0-rc.2"
bytes = "1"
dashu = "0.4.0"
num-order = { version = "1.2.0" }
@@ -79,7 +78,7 @@ crossterm = { version = "0.20.0", optional = true }
ctrlc = { version = "3.2.2", optional = true }
rustyline = { version = "12.0.0", optional = true }
native-tls = { version = "0.2.4", optional = true }
hyper = { version = "=1.0.0-rc.3", features = ["full"], optional = true }
warp = { version = "=0.3.5", features = ["tls"], optional = true }
reqwest = { version = "0.11.18", features = ["blocking"], optional = true }
tokio = { version = "1.28.2", features = ["full"] }