搜索插件、代码仓与 APP 分类

插件详情v1.0.1

web_socket

一个易于使用的 WebSocket 通信库,支持多种实现。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1170万
喜欢数
67
Pub 分数
160

安装插件

flutter pub add web_socket

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个简单且灵活的 Dart 包,用于在多个平台上建立和管理 WebSocket 连接。它为客户端和服务器之间的实时通信提供了一致的 API,支持客户端和服务器端实现。设计简洁易用,可无缝集成到 Flutter 应用和其他 Dart 项目中,以最少的样板代码实现双向数据交换。该库由 Dart 团队维护,支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

适合场景

  • 实时聊天应用
  • 实时数据流
  • 在线游戏
  • 物联网设备通信
  • 同步仪表板
  • 服务器发送事件

主要特点

  • 跨平台兼容性
  • 连接管理的简单API
  • 同时支持客户端和服务器角色
  • 内置错误处理
  • 自动重连尝试
  • 轻便高效

适合对象

  • 开发实时功能的开发者
  • 需要持久连接的应用程序
  • 需要低延迟更新的项目
  • 使用 Dart/Flutter 进行全栈开发的团队
  • 面向多个平台的应用程序

使用建议

  • 需要一个 WebSocket 服务器端点
  • 可能需要自定义逻辑进行消息序列化
  • 不适用于单次HTTP请求
  • 性能取决于网络状况
  • 身份验证和安全必须分开处理

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Build Status

A composable, Future-based library for making HTTP requests.

package:http contains a set of high-level functions and classes that make it easy to consume HTTP resources. It's multi-platform, and supports mobile, desktop, and the browser.

Packages

Package Description Version
cronet_http An Android Flutter plugin that provides access to the Cronet HTTP client. pub package
cupertino_http A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System. pub package
flutter_http_example An Flutter app that demonstrates how to configure and use package:http. —
http A composable, multi-platform, Future-based API for HTTP requests. pub package
http2 A HTTP/2 implementation in Dart. pub package
http_client_conformance_tests A library that tests whether implementations of package:http's Client class behave as expected.
http_multi_server A dart:io HttpServer wrapper that handles requests from multiple servers. pub package
http_parser A platform-independent package for parsing and serializing HTTP formats. pub package
http_profile A library used by HTTP client authors to integrate with the DevTools Network View. pub package
ok_http An Android Flutter plugin that provides access to the OkHttp HTTP client and the OkHttp WebSocket API. pub package
web_socket Any easy-to-use library for communicating with WebSockets that has multiple implementations. pub package
web_socket_channel StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API. package issues
web_socket_conformance_tests A library that tests whether implementations of package:web_socket's WebSocket class behave as expected.

Contributing

If you'd like to contribute to any of these packages, see the Contributing Guide.

所属分类

依赖

依赖清单 1 项

  • web>=0.5.0 <2.0.0

源码仓库

使用此插件的项目