Coder Social home page Coder Social logo

huddle01 / dart-protoo-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zackmitkin/dart-protoo-client

0.0 0.0 0.0 59 KB

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

License: MIT License

Dart 90.75% JavaScript 9.25%

dart-protoo-client's Introduction

Note

This package is a fork of dart-protoo-client from pub.

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

dart-protoo-client's People

Contributors

blancduman avatar cloudwebrtc avatar kangshaojun avatar renovate-bot avatar ritvij14 avatar zackmitkin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.