git ssb

10+

Matt McKegg / patchwork



Tree: 2cccc563e935c542ce7c37f90eab873bdc17f1ac

Files: 2cccc563e935c542ce7c37f90eab873bdc17f1ac / modules / obs-local.js

520 bytesRaw
1var MutantSet = require('@mmckegg/mutant/set')
2var plugs = require('patchbay/plugs')
3var sbot_gossip_peers = plugs.first(exports.sbot_gossip_peers = [])
4var ip = require('ip')
5
6exports.obs_local = function () {
7 var result = MutantSet([], {nextTick: true})
8 sbot_gossip_peers((err, peers) => {
9 if (err) throw console.log(err)
10 peers.filter((peer) => {
11 if (ip.isPrivate(peer.host) && (peer.source === 'local')) {
12 console.log(peer)
13 result.add(peer.key)
14 }
15 })
16 })
17 return result
18}
19

Built with git-ssb-web