mirror of https://github.com/rwf2/Rocket.git
fd294049c7
This commit completely rewrites Rocket's HTTP serving. In addition to significant internal cleanup, this commit introduces the following major features: * Support for custom, external listeners in the `listener` module. The new `listener` module contains new `Bindable`, `Listener`, and `Connection` traits which enable composable, external implementations of connection listeners. Rocket can launch on any `Listener`, or anything that can be used to create a listener (`Bindable`), via a new `launch_on()` method. * Support for Unix domain socket listeners out of the box. The default listener backwards compatibly supports listening on Unix domain sockets. To do so, configure an `address` of `unix:path/to/socket` and optional set `reuse` to `true` (the default) or `false` which controls whether Rocket will handle creating and deleting the unix domain socket. In addition to these new features, this commit makes the following major improvements: * Rocket now depends on hyper 1. * Rocket no longer depends on hyper to handle connections. This allows us to handle more connection failure conditions which results in an overall more robust server with fewer dependencies. * Logic to work around hyper's inability to reference incoming request data in the response results in a 15% performance improvement. * `Client`s can be marked secure with `Client::{un}tracked_secure()`, allowing Rocket to treat local connections as running under TLS. * The `macros` feature of `tokio` is no longer used by Rocket itself. Dependencies can take advantage of this reduction in compile-time cost by disabling the new default feature `tokio-macros`. * A new `TlsConfig::validate()` method allows checking a TLS config. * New `TlsConfig::{certs,key}_reader()`, `MtlsConfig::ca_certs_reader()` methods return `BufReader`s, which allow reading the configured certs and key directly. * A new `NamedFile::open_with()` constructor allows specifying `OpenOptions`. These improvements resulted in the following breaking changes: * The MSRV is now 1.74. * `hyper` is no longer exported from `rocket::http`. * `IoHandler::io` takes `Box<Self>` instead of `Pin<Box<Self>>`. - Use `Box::into_pin(self)` to recover the previous type. * `Response::upgrade()` now returns an `&mut dyn IoHandler`, not `Pin<& mut _>`. * `Config::{address,port,tls,mtls}` methods have been removed. - Use methods on `Rocket::endpoint()` instead. * `TlsConfig` was moved to `tls::TlsConfig`. * `MutualTls` was renamed and moved to `mtls::MtlsConfig`. * `ErrorKind::TlsBind` was removed. * The second field of `ErrorKind::Shutdown` was removed. * `{Local}Request::{set_}remote()` methods take/return an `Endpoint`. * `Client::new()` was removed; it was previously deprecated. Internally, the following major changes were made: * A new `async_bound` attribute macro was introduced to allow setting bounds on futures returned by `async fn`s in traits while maintaining good docs. * All utility functionality was moved to a new `util` module. Resolves #2671. Resolves #1070. |
||
---|---|---|
.. | ||
static | ||
absolute-uris-okay-issue-443.rs | ||
adhoc-uri-normalizer.rs | ||
byte-slices-form-field-issue-2148.rs | ||
can-correct-bad-local-uri.rs | ||
can-launch-tls.rs | ||
catcher-cookies-1213.rs | ||
conditionally-set-server-header-996.rs | ||
config-proxy-proto-header.rs | ||
config-real-ip-header.rs | ||
config-secret-key-1500.rs | ||
cookies-private.rs | ||
derive-reexports.rs | ||
deserialize-limits-issue-2268.rs | ||
encoded-uris.rs | ||
fairing_before_head_strip-issue-546.rs | ||
file_server.rs | ||
flash-lazy-removes-issue-466.rs | ||
form-validation-names.rs | ||
form_method-issue-45.rs | ||
form_value_decoding-issue-82.rs | ||
form_value_from_encoded_str-issue-1425.rs | ||
forward-includes-status-1560.rs | ||
head_handling.rs | ||
http_serde.rs | ||
launch-inspect.rs | ||
limits.rs | ||
local-client-access-runtime-in-drop.rs | ||
local-client-json.rs | ||
local-request-content-type-issue-505.rs | ||
local_request_private_cookie-issue-368.rs | ||
many-cookie-jars-at-once.rs | ||
mapped-base-issue-1262.rs | ||
mount_point.rs | ||
multipart-limit.rs | ||
nested-fairing-attaches.rs | ||
on_launch_fairing_can_inspect_port.rs | ||
panic-handling.rs | ||
precise-content-type-matching.rs | ||
raw-strings-multipart-files-1987.rs | ||
recursive-singleton-fairing.rs | ||
redirect_from_catcher-issue-113.rs | ||
replace-content-type-518.rs | ||
responder_lifetime-issue-345.rs | ||
route_guard.rs | ||
scoped-uri.rs | ||
segments-issues-41-86.rs | ||
sentinel.rs | ||
session-cookies-issue-1506.rs | ||
shield.rs | ||
shutdown-fairings.rs | ||
strict_and_lenient_forms.rs | ||
timer-on-attach.rs | ||
tls-config-from-source-1503.rs | ||
twice_managed_state.rs | ||
typed-uri-docs-redef-issue-1373.rs | ||
unsound-local-request-1312.rs | ||
untracked-vs-tracked.rs | ||
uri-percent-encoding-issue-808.rs |