git ssb

10+

Matt McKegg / patchwork



Tree: 05c5b4f2078be5153b1a4ff2c0f7455a930242b1

Files: 05c5b4f2078be5153b1a4ff2c0f7455a930242b1 / 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