From 37e0fdd3cfc13039fd52af463ff9138988e2922f Mon Sep 17 00:00:00 2001 From: jadidbourbaki Date: Tue, 4 Aug 2026 12:56:23 -0400 Subject: [PATCH] feat(rocket): launch SesameRocket on a caller-supplied Listener SesameRocket::launch only reaches the transports Rocket ships with, so a Sesame application with its own TLS stack cannot serve at all. Add launch_with_listener, forwarding to the same method on the underlying Rocket. Depends on KinanBab/Rocket#1, which adds that method. Merging this before that lands will not compile. --- sesame/rocket/src/rocket/rocket.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sesame/rocket/src/rocket/rocket.rs b/sesame/rocket/src/rocket/rocket.rs index 571b3e5..8929e75 100644 --- a/sesame/rocket/src/rocket/rocket.rs +++ b/sesame/rocket/src/rocket/rocket.rs @@ -21,6 +21,17 @@ impl SesameRocket { } } // Finish building by launching and awaiting result. + /// Launch on a caller-supplied `Listener` instead of Rocket's + /// built-in TCP and rustls pair, for applications that bring their + /// own TLS stack. Forwards to `Rocket::launch_with_listener`. + pub async fn launch_with_listener(self, listener: L) -> Result<(), rocket::Error> + where + L: rocket::http::private::Listener + Send, + ::Connection: Send + Unpin + 'static, + { + self.frontend.launch_with_listener(listener).await + } + pub async fn launch(self) -> Result<(), rocket::Error> { self.frontend.launch().await }