1.0.12 • Published 3 years ago

openfin-webrtc-client v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

client library for webrtc-signaling

Client libraryto add real-time communication capabilities with signaling service and WebRTC.

Build the project

  1. Install project dependencies.
   npm i
  1. Build the project.
   npm run build

Usage

  1. Install the module for your project.
   npm install --save openfin-webrtc-client
  1. Import.
import { Configuration, PeerConnection } from 'openfin-webrtc-client';
  1. Create and initialize a PeerConnection.
    const configuration: Configuration = {
        signalingBaseUrl: 'https://webrtc-signaling-hostname',
        pairingCode: 'webrtcExample', // both peers of a connection need to have the same pairingCode
    };

    const peerConnection:PeerConnection = new PeerConnection(configuration);
    await peerConnection.initialize()
    const peerChannel:PeerChannel = await peerConnection.createChannel('MyChannel');

    // listen for messages sent by the remote peer
    peerChannel.onMessage((data: String) => {
        console.log(data);
    });

    // send data to the remote peer
    peerChannel.send('Hello');
  1. Listen to event for channels created by the both peers.
   peerConnection.onChannel((channel: PeerChannel) => {
       if (channel.name !== 'MyChannel') {
        channel.send('Hello Peer');
       }
   });

Next Steps and Known Issues

 * Add configuration for the location of the:
    * signaling server
 * Documentation
 * Automate the process to pair the machines:
    * Currently a shared secret
    * Ability to extend/remove a pairing (currently based on session)
 * Determine client library packing/delivery (probably part of InterOp)
 * Document the use cases we can support, associated test cases and QA
1.0.11

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago