Skip to content

feat(core): launch on a caller-supplied Listener - #1

Open
jadidbourbaki wants to merge 1 commit into
KinanBab:mainfrom
jadidbourbaki:feat/launch-with-listener
Open

feat(core): launch on a caller-supplied Listener#1
jadidbourbaki wants to merge 1 commit into
KinanBab:mainfrom
jadidbourbaki:feat/launch-with-listener

Conversation

@jadidbourbaki

Copy link
Copy Markdown
Collaborator

Rocket's launch can only use the transports it ships with, TCP and rustls. An application that brings its own TLS stack therefore has no way to serve through Rocket at all. I hit this driving fizz-rs TLS in the Tahini benchmarks, and worked around it by vendoring a patched copy of your fork, which I would rather not keep doing. This adds Rocket::launch_with_listener, which accepts any Listener and runs the same sequence launch does: ignite if the instance is still building, run liftoff fairings, log the launch, then hand the listener to the accept loop. It also makes http_server public, which is the "make this function public" half of the TODO already sitting above that function; default_tcp_http_server is untouched and stays the built-in path, so nothing about existing behavior changes. My motivation is a follow-up in Sesame: sesame_rocket's SesameRocket needs a matching wrapper so Sesame applications can pass a listener through, and that wrapper can only exist once the underlying Rocket exposes this. With both in place I can drop two vendored trees and depend on your fork directly.

`launch` can only use the transports Rocket ships with, so an
application with its own TLS stack has no way to serve through Rocket.
Add `Rocket::launch_with_listener`, which takes any `Listener` and runs
the same ignite-then-serve sequence `launch` does, liftoff fairings
included, then hands the listener to the accept loop.

This also makes `http_server` public, which is the "make this function
public" half of the TODO already sitting above it. `default_tcp_http_server`
is untouched and remains the built-in path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant