Helper to build an Eventsource using reqwest
See the codeProvides a simple wrapper for [reqwest] to provide an Event Source implementation.
You can learn more about Server Sent Events (SSE) take a look at the MDN
docs
This crate uses [eventsource_stream] to wrap the underlying Bytes stream, and retries failed
requests.
let mut es = EventSource::get("http://localhost:8000/events");
while let Some(event) = es.next().await {
match event {
Ok(Event::Open) => println!("Connection Open!"),
Ok(Event::Message(message)) => println!("Message: {:#?}", message),
Err(err) => {
println!("Error: {}", err);
es.close();
}
}
}
License: MIT OR Apache-2.0
Overall
Maintained
Code review
crates.io
Latest release
Releases this year
4,629 followers · starred Feb 2022
208 followers · starred May 2023
289 followers · starred Aug 2023
968 followers · starred Sep 2025
Helper to build an Eventsource using reqwest
See the codeProvides a simple wrapper for [reqwest] to provide an Event Source implementation.
You can learn more about Server Sent Events (SSE) take a look at the MDN
docs
This crate uses [eventsource_stream] to wrap the underlying Bytes stream, and retries failed
requests.
let mut es = EventSource::get("http://localhost:8000/events");
while let Some(event) = es.next().await {
match event {
Ok(Event::Open) => println!("Connection Open!"),
Ok(Event::Message(message)) => println!("Message: {:#?}", message),
Err(err) => {
println!("Error: {}", err);
es.close();
}
}
}
License: MIT OR Apache-2.0
Overall
Maintained
Code review
crates.io
Latest release
Releases this year
4,629 followers · starred Feb 2022
208 followers · starred May 2023
289 followers · starred Aug 2023
968 followers · starred Sep 2025