An open API service indexing awesome lists of open source software.

https://github.com/dev1an/eventsource

Swift library to read SSE / EventSources. Works on macOS and Linux
https://github.com/dev1an/eventsource

event-emitter event-source event-source-client http linux macos server-sent-events sse

Last synced: 7 months ago
JSON representation

Swift library to read SSE / EventSources. Works on macOS and Linux

Awesome Lists containing this project

README

          

## Installation

on **Linux** some packages need to be installed first:

```
sudo apt-get install libssl-dev uuid-dev libcurl4-openssl-dev
```

## Usage

```swift
let firebase = "https://homecontrol-f0066.firebaseio.com/Home/0/Radio/0/currentChannel.json"

EventStream(from: firebase) {
print("event:", $0)
print("data:", $1)
}
```

## Missing features

- Newline separators: the library currently only works with `\n` as newline. The following separaters are not supported:
- `\r\n`
- `\r`