Migrating from v1 to v2¶
v2 introduces notable changes including new features, performance improvements and new target support like ARM64 and OSes like FreeBSD, NetBSD, Illumos or Android.
v2 was re-written almost from scratch on top of Hyper and Tokio runtime which gives us the Rust asynchronous ability by default and the latest HTTP/1 - HTTP/2 implementation improvements. However, it still tries to keep the same principles of its
v1: lightness and easy-to-use. Therefore migration should not be a big deal.
v2 breaking changes¶
v2 has a few breaking changes. However, migration should not represent a problem.
It is always worth recommending that you test a major server version upgrade like this first with your application(s) in a development environment or similar.
Please keep in mind the following changes in
- The server now supports only a root directory path (via
--rootor its equivalent env) so an assets path option is no longer required.
- Cache-control headers are arbitrarily applied to assets. See control headers examples for more details.
- OpenSSL TLS for HTTP/1 is no longer supported, instead for the HTTP/2 & TLS (via
--http2option) the server uses h2 which is on top of Rustls. It means that instead of using a
.pfxfile you can now use only a certificate file along with its private key. See HTTP/2 & TLS examples for more details.
- If using HTTP to HTTPS redirect, then check out the new feature page to adjust the options accordingly.
The rest of the known options are equivalent to
v1 (except the new ones of course).
For feedback or questions feel free to reach us on the discussions page.