Created
April 21, 2018 15:47
-
-
Save jondashkyle/19fce7dee0baf9d74167b1b7e9a33ad8 to your computer and use it in GitHub Desktop.
polling for peers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://beakerbrowser.com/docs/apis/dat.html#getinfo | |
var archive = new DatArchive(window.location.toString()) | |
var peers = 0 | |
setInterval(checkPeers, 2000) | |
async function checkPeers () { | |
var info = await archive.getInfo() | |
peers = info.peers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment