https://github.com/lluchs/eventsource
Rust client for the EventSource browser API
https://github.com/lluchs/eventsource
eventsource
Last synced: 3 months ago
JSON representation
Rust client for the EventSource browser API
- Host: GitHub
- URL: https://github.com/lluchs/eventsource
- Owner: lluchs
- License: mit
- Created: 2016-05-26T22:35:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-13T22:22:55.000Z (over 5 years ago)
- Last Synced: 2026-03-29T17:22:50.520Z (3 months ago)
- Topics: eventsource
- Language: Rust
- Size: 34.2 KB
- Stars: 23
- Watchers: 1
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# EventSource
[](https://crates.io/crates/eventsource) [](https://docs.rs/eventsource/) [](https://travis-ci.org/lluchs/eventsource)
EventSource is a Rust library for reading from Server-Sent Events endpoints. It transparently
sends HTTP requests and only exposes a stream of events to the user. It handles automatic
reconnection and parsing of the `text/event-stream` data format.
## Examples
```rust
use eventsource::reqwest::Client;
use reqwest::Url;
fn main() {
let client = Client::new(Url::parse("http://example.com").unwrap());
for event in client {
println!("{}", event.unwrap());
}
}
```