Plink makes networking browsers easy
Plink is small tool (a thin layer on top of P) for creating data channels between two browsers.
Example
Here's an example of two applications which will establish a peer-to-peer connection with each other using a plink-server and then send greetings to each other via a peer-to-peer data channel.
hello.html
Hello!
hi.html
Hi!
Note that the "Hello!" and "Hi!" messages never go through the plink-server. The plink-server is only used to help the two peers connect to each other using a shared passcode.
API
// Create root plink instancevar plink = Plink; // Connect to a plink-servervar plinkServer = plink; // Set a key. Other peers can use to connect to this browser using this // key via a the connected plink-server.// Returns a promise on whether the operation succeeded.var promise = plinkServer; // Set a key with an expiration in milliseconds// Returns a promise on whether the operation succeeded.var promise = plinkServer; // Revoke a key.// Returns a promise on whether the operation succeeded.var promise = plinkServer; // Use a key to connect to a peer.// Returns a promise for a WebRtcNode, please see the P documentation for// the API of the WebRtcNode.var webRtcNodePromise = plinkServer; // EventsplinkServer;plinkServer;plinkServer;plinkServer;plinkServer;