Files: 2cccc563e935c542ce7c37f90eab873bdc17f1ac / modules / obs-local.js
520 bytesRaw
1 | var MutantSet = require('@mmckegg/mutant/set') |
2 | var plugs = require('patchbay/plugs') |
3 | var sbot_gossip_peers = plugs.first(exports.sbot_gossip_peers = []) |
4 | var ip = require('ip') |
5 | |
6 | exports.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