Skip to content

Minimalist and extensible Dart signaling framework for multi-party Real-Time Communication applications

License

Notifications You must be signed in to change notification settings

flutter-webrtc/dart-protoo-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pub package

protoo-client

Dart version of the protoo-client js library.

Minimalist and extensible Dart signaling framework for multi-party Real-Time Communication applications

Usage

import 'package:protoo_client/protoo_client.dart';

main() async {

  Peer peer = new Peer('ws://127.0.0.1:4442/?peer-id=yourId');

  peer.on('open', () {
    // After socket open to send a request.
    peer.send('login', {'username':'myname','password','mypass', 'other': {}})
    .then((data) {
      // Handle accept from server.
      print('response: ' + data.toString());
    }).catchError((error) {
      // Handle reject from server.
      print('response error: ' + error.toString());
    });
  });

  peer.on('close', () {
    print('close');
  });

  peer.on('error', (error) {
    print('error ' + error);
  });
 
  // Handle request from server.
  peer.on('request', (request, accept, reject) {
    print('request: ' + request.toString());
    reject(486, 'Busy Here!!!');
  });

  await peer.connect();
  peer.close();
}

About

Minimalist and extensible Dart signaling framework for multi-party Real-Time Communication applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published