패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.4.0

eventsource

서버 전송 이벤트의 클라이언트 및 서버 구현.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
595
좋아요
30
Pub 점수
120

패키지 설치

flutter pub add eventsource

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

서버에서 클라이언트로 실시간 단방향 통신을 가능하게 하는 서버 전송 이벤트(SSE)용 클라이언트 및 서버 구현을 제공하는 Dart 패키지입니다. HTTP를 통해 이벤트 스트리밍을 지원하여 실시간 업데이트, 알림, 데이터 피드에 적합합니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼과 호환됩니다. SSE 표준을 따르며, 이벤트 ID, 재시도 간격, 사용자 정의 이벤트 유형을 지원합니다. 경량 구현으로 Flutter 및 Dart 애플리케이션에 원활하게 통합됩니다.

사용 사례

  • 실시간 알림
  • 실시간 데이터 스트리밍
  • 서버 측 이벤트 브로드캐스팅
  • 웹 앱에서 상태 업데이트
  • 인터랙티브 대시보드
  • 로그 스트리밍

주요 기능

  • 완전한 SSE 프로토콜 지원
  • 크로스 플랫폼 호환성
  • 이벤트 ID 및 재시도 처리
  • 사용자 정의 이벤트 유형 지원
  • 경량이고 효율적
  • Flutter와의 간편한 통합

적합한 대상

  • 실시간 앱 기능
  • 푸시 기능이 필요한 백엔드 서비스
  • 저지연 업데이트가 필요한 앱
  • 실시간 콘텐츠를 갖춘 웹 및 모바일 앱
  • 풀스택 앱을 위한 Dart/Flutter 사용 개발자

고려 사항

  • 양방향 통신에 적합하지 않습니다
  • 호환되는 서버 구현이 필요합니다
  • 서버에서 클라이언트로의 스트리밍에 한정
  • 인증을 위해 추가 설정이 필요할 수 있습니다
  • 고주파, 저지연 업데이트에 가장 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

eventsource

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.

Client usage

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());

Server usage

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.

Licensing

This project is available under the MIT license, as can be found in the LICENSE file.

카테고리

의존성

의존성 목록 5 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.