From 2fc44386aff6ddf2808897a253a47e57feaba926 Mon Sep 17 00:00:00 2001 From: Ivan Nikulin Date: Thu, 3 Dec 2020 01:25:18 +0000 Subject: [PATCH] Add support for wss: scheme in hyper-boring --- hyper-boring/Cargo.toml | 2 +- hyper-boring/src/lib.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hyper-boring/Cargo.toml b/hyper-boring/Cargo.toml index edabf46e..d7a025a2 100644 --- a/hyper-boring/Cargo.toml +++ b/hyper-boring/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hyper-boring" -version = "1.0.2" +version = "1.0.3" authors = ["Steven Fackler ", "Ivan Nikulin "] edition = "2018" description = "Hyper TLS support via BoringSSL" diff --git a/hyper-boring/src/lib.rs b/hyper-boring/src/lib.rs index 6891ad5f..70c4b705 100644 --- a/hyper-boring/src/lib.rs +++ b/hyper-boring/src/lib.rs @@ -209,7 +209,12 @@ where } fn call(&mut self, uri: Uri) -> Self::Future { - let tls_setup = if uri.scheme() == Some(&Scheme::HTTPS) { + let is_tls_scheme = uri + .scheme() + .map(|s| s == &Scheme::HTTPS || s.as_str() == "wss") + .unwrap_or(false); + + let tls_setup = if is_tls_scheme { Some((self.inner.clone(), uri.clone())) } else { None