eventsource
서버 전송 이벤트의 클라이언트 및 서버 구현.
서버사이드 이벤트의 클라이언트 및 서버 구현입니다.
^1.15.0^0.13.3^4.0.0^1.0.1^0.3.0^1.17.11아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A library for using EventSource or Server-Sent Events (SSE). Both client and server functionality is provided.
This library implements the interface as described here.
For more advanced usage, see the example/ directory.
Creating a new EventSource client is as easy as a single call.
The http package is used under the hood, so wherever this package works, this library will also work.
Browser usage is slightly different.
EventSource eventSource = await EventSource.connect("http://example.com/events");
// in browsers, you need to pass a http.BrowserClient:
EventSource eventSource = await EventSource.connect("http://example.com/events",
client: new http.BrowserClient());
We recommend using shelf_eventsource for
serving Server-Sent Events.
This library provides an EventSourcePublisher that manages subscriptions, channels, encoding.
We refer to documentation in the shelf_eventsource
package for more information.
This library also includes a server provider for dart:io's HttpServer in io_server.dart.
However, it has some issues with data flushing that are yet to be resolved, so we recommend using
shelf instead.
This project is available under the MIT license, as can be found in the LICENSE file.