Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd HTTP/2 push support to Server #1586
Open
Comments
This comment has been minimized.
This comment has been minimized.
|
First step is that the h2 dependency would need Push support: hyperium/h2#291 |
This comment has been minimized.
This comment has been minimized.
|
With
An example using this proposal looks like this: async fn handle(mut req: Request<Body>) -> Result<Response<Body>, E> {
match hyper::push::pusher(&mut req) {
Ok(mut pusher) => {
let promise = Request::builder()
.uri("/app.js")
.body(())
.unwrap();
if let Err(e) = pusher.push_request(promise).await {
eprintln!("push failed: {}", e);
}
},
Err(e) => eprintln!("http2 pusher unavailable: {}", e),
}
Ok(Response::new(index_page_stream()))
} |
This comment has been minimized.
This comment has been minimized.
|
@stammw would the proposed API make sense for HTTP 3? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the state of HTTP/2 server push in hyper? I couldn't find anything in the documentation. Are there any plans to implement it in the future?