A way of inserting http header in sse stream response? #2214
-
i have a problem that sse stream response has been buffered by nginx so let stream = stream::repeat_with(|| Event::default().data("hi!"))
.take(5)
.map(Ok)
.throttle(Duration::from_secs(1));
let sse = Sse::new(stream)
.keep_alive(KeepAlive::default()); this code gets buffered and no response to client till 5 seconds goes. so im finding a way of inserting http header in sse stream response. but it seems not possible currently. |
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Sep 8, 2023
Replies: 1 comment 2 replies
-
See https://docs.rs/axum/0.6.20/axum/response/index.html#building-responses |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, you can return
(header_map, sse)