1
0
mirror of https://github.com/actix/examples synced 2024-11-24 14:53:00 +01:00
examples/basics/middleware-http-to-https
2021-10-13 15:06:42 +01:00
..
src Middleware example - Redirect http connections to https (#457) 2021-10-13 15:06:42 +01:00
Cargo.toml Middleware example - Redirect http connections to https (#457) 2021-10-13 15:06:42 +01:00
cert.pem Middleware example - Redirect http connections to https (#457) 2021-10-13 15:06:42 +01:00
key.pem Middleware example - Redirect http connections to https (#457) 2021-10-13 15:06:42 +01:00
README.md Middleware example - Redirect http connections to https (#457) 2021-10-13 15:06:42 +01:00

Middleware eg - redirect any http connection to use https connection

This example is the next step after implementing this example : Setup TLS via rustls.

You might have already implemented TLS(using one of the ways mentioned in the example of security section), and have setup your server to listen to port 443(for https).

Now, the only problem left to solve is, to listen to http connections as well and redirect them to use https

Usage

Note : You will be required to use sudo while running the binary to access port 80 and 443