mirror of https://github.com/kern/filepizza
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
372 B
JavaScript
16 lines
372 B
JavaScript
import Actions from './Actions';
|
|
import Peer from 'peerjs';
|
|
|
|
var peer = module.exports = new Peer({ key: '8w3x9m637e0o1or' });
|
|
|
|
peer.on('open', function () {
|
|
Actions.updatePeerID(peer.id);
|
|
if (window.token) Actions.requestDownload(window.token);
|
|
});
|
|
|
|
peer.on('connection', function (conn) {
|
|
conn.on('data', function (data) {
|
|
Actions.receiveData(data);
|
|
});
|
|
});
|