git ssb

1+

cheerbitch / dexbot



Commit 061e3e72a74371aae02321b09a7ba522a143fa4a

bonjour

Tree committed on 12/14/2016, 4:01:03 AM
Parent: 1c3bb55caa34e2ddba219e58aec5893424a109b0

Files changed

index.jschanged
readme.mdadded
index.jsView
@@ -2,8 +2,9 @@
22 var keys = require('./keys.json')
33 var appkey = require('./appkeys.json')
44 var muxrpc = require('muxrpc')
55 var ms = require('multiserver')
6 +var mdns = require('mdns')
67
78 var createApp = secretStack({
89 appKey: appkey.private
910 }).use({
@@ -28,5 +29,19 @@
2829 var node = createApp({
2930 keys: keys
3031 })
3132
33 +var record = {
34 + name: process.argv[3] || 'poopface',
35 + address: node.getAddress()
36 +}
37 +
38 +var ad = mdns.createAdvertisement(mdns.tcp('http'), 11111, {txtRecord: record})
39 +ad.start()
40 +
41 +var browser = mdns.createBrowser(mdns.tcp('http'), 11111)
42 +browser.on('serviceUp', function(service){
43 + console.log(service.txtRecord.address)
44 +})
45 +
46 +
3247 console.log(node.getAddress())
readme.mdView
@@ -1,0 +1,1 @@
1 +this lib needed for avahi for node module mdns: `libavahi-compat-libdnssd-dev`

Built with git-ssb-web