Crates.io | tokio-tls-listener |
lib.rs | tokio-tls-listener |
version | 0.2.0 |
source | src |
created_at | 2023-06-01 20:55:29.299182 |
updated_at | 2024-06-04 19:31:32.076836 |
description | Thin wrapper around `tokio-rustls` to make it a little easier to use |
homepage | |
repository | https://github.com/nurmohammed840/tokio-tls-listener |
max_upload_size | |
id | 880179 |
size | 6,736 |
A thin wrapper around tokio-rustls to make it a little bit easier to use.
use tokio_tls_listener::{TlsListener, tls_config};
async {
let conf = tls_config("./cert.pem", "./key.pem").unwrap();
let listener = TlsListener::bind("127.0.0.1:4433", conf).await.unwrap();
loop {
let Ok((stream, addr)) = listener.accept_tls().await else { continue };
// ...
}
};