utd_channels 0.2.0 copy "utd_channels: ^0.2.0" to clipboard
utd_channels: ^0.2.0 copied to clipboard

Standalone Pusher-style realtime SDK for UTD-Stream-Engine: channels (public/private/presence), event pub/sub, presence member lists, and typed connection lifecycle. Pure Dart — no Flutter, no UI, no [...]

Changelog #

0.2.0 #

Security hardening (from a full audit).

  • TLS is enforced. connectWebSocketTransport refuses a non-wss:// dial and obtainConnectionToken / obtainChannelGrant refuse a non-https:// endpoint (loopback exempt). New UTDTransportSecurity exposes the policy and an allowInsecure dev escape hatch.
  • Defensive frame parsing. UTDFrame.tryParse degrades a non-object data to an empty map, drops frames larger than UTDFrame.maxFrameBytes (1 MB), and the socket/client coerce error-, ack-, and presence-member fields instead of hard-casting — a hostile or buggy server can no longer crash the client.
  • insecureDevelopment strategies throw in release (product) builds unless UTDTransportSecurity.allowInsecure is set.

0.1.0 #

Initial release — the generic realtime core extracted from utd_signaling.

  • UTDChannelsClient: public / private- / presence- channels by name prefix, subscribe-before-connect queuing, automatic resubscription with fresh channel auth after every reconnect.
  • Stream-based event API: bind, bindJson<T>, bindAll, plus a global events stream.
  • Ack-based trigger for client events with local rule enforcement (client- prefix, private/presence only, subscribed only, ≤ 10 KB) and typed server errors (UTDRateLimitedException, …).
  • Presence: member snapshot on subscribe, me, memberAdded/memberRemoved.
  • UTDAuth (sealed): insecureDevelopment (publishable-key mint, dev only), tokenProvider, endpoint. Proactive re-mint before token expiry.
  • UTDChannelAuth (sealed): Pusher-byte-compatible endpoint contract (form-encoded socket_id/channel_name, {auth, channel_data?} response — existing pusher-http-*/Laravel endpoints work unchanged), authorizer callback, insecureDevelopment.
  • UTDSocket: request/ack correlation, capped exponential backoff with full jitter (ReconnectPolicy), keepalive probing (KeepAlivePolicy), fatal close-code handling (4000–4099, 4003 → signedInElsewhere), and the request()/frames escape hatches domain layers build on.
  • Machine-readable error codes only — no message sniffing.
0
likes
150
points
129
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Standalone Pusher-style realtime SDK for UTD-Stream-Engine: channels (public/private/presence), event pub/sub, presence member lists, and typed connection lifecycle. Pure Dart — no Flutter, no UI, no UTD kits required.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

http, web_socket_channel

More

Packages that depend on utd_channels