http-timings: A library to measure HTTP timings
Inspired by the libraries TTFB by phip1611 and ssl-expiration by onur. This library provides the following information from any given URL:
- Status code
- Body of the response
- SSL Certificate information
- DNS Lookup Time
- TCP Connection Time
- TLS Handshake Time
- HTTP Send Time
- Time to First Byte
- Content Download Time
Usage
use from_string;
let url = "https://www.example.com";
let timeout = Some; // Set a timeout of 5 seconds
match from_string
The Response
struct provides all the information about the request. The timings in both relative and total terms. The relative timings are the time taken for each step of the request, while the total timings are the time taken from the start of the request to the end of the request.
The URL input can be any valid website as well as any valid IP.