web_socket_cli 0.0.2 copy "web_socket_cli: ^0.0.2" to clipboard
web_socket_cli: ^0.0.2 copied to clipboard

A cross-platform WebSocket client with support for headers and followRedirects.

Web_Socket_Cli Package #

A cross-platform WebSocket client for Flutter and Dart applications. Supports headers, redirects, and works on web, iOS, and Android.

Features #

  • Cross-platform support (web, iOS, Android).
  • Custom headers for WebSocket connections.
  • Redirect handling (on supported platforms).

Installation #

Add the following to your pubspec.yaml:

dependencies:
  web_socket_cli: ^0.0.2

Run flutter pub get or dart pub get to install the package.

Usage #

import 'package:web_socket_cli/web_socket_cli.dart';

void main() {
  final client = WebSocketClient(
    'wss://example.com/socket',
    headers: {'Authorization': 'Bearer YOUR_TOKEN'},
    followRedirects: true,
  );

  client.messages.listen((message) {
    print('Received: $message');
  });

  client.send('Hello, WebSocket!');
}

0
likes
0
points
91
downloads

Publisher

unverified uploader

Weekly Downloads

A cross-platform WebSocket client with support for headers and followRedirects.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, universal_io

More

Packages that depend on web_socket_cli