An utility that bridgen Bonjour/mDNS discovery accross Yggdrasil mesh network, allowing local discovery protocols to work over IPv6 mesh network.
Bonjour (XEP-0174) only works on local networks. Applications like Pidgin, Adium, Gajim, etc use Bonjour for serverless local messaging, but this limits communication to devices on the same LAN.
Yggdrasil provides an IPv6 mesh network where all nodes can reach each other directly, but Bonjour-enabled applications don't know how to discover peers over Yggdrasil.
This bridge "fakes" local Bonjour presence for remote Yggdrasil contacts. It:
- Monitors connectivity to remote Yggdrasil peers
- Advertises them as local when they're reachable
- Removes advertisements when they go offline
- Tricks Bonjour clients into thinking remote peers are on the local network
When your Bonjour client connects to these "local" contacts, it actually connects over Yggdrasil IPv6 addresses.
[pidgin] <--local--> [avahi-daemon] <--ygg-bonjour--> [yggdrasil network] <---> [remote pidgin]
^
|
ygg-bonjour advertises
remote contact as local
Currently, the bridge uses avahi-publish-address and avahi-publish-service to advertise remote contacts with their Yggdrasil IPv6 addresses, making them appear as local Bonjour services.
- Yggdrasil mesh network daemon (that is configured in a way you can see your contacts IPv6 addresses)
- Avahi mDNS/DNS-SD daemon (
avahi-daemonrunning) - Root access required for
avahi-publishcommands. - Any Bonjour client that listens on 5298 port (later we'll make the port configurable)
So should work on Linux, BSD systems, everywhere you can have Pidgin/Bonjour (or other Bonjour client), Avahi, Yggdrasil and FreePascal compiler.
fpc ybb.pas
or type
make
you need to have FreePascal installed. (:
You need a config file that lists remote Yggdrasil contacts:
201:b570:cb42:54ee:9b56:dfa0:7ba1:f4b5,pinephone,alice
202:f0b8:b922:8c76:8393:1954:ed69:ae2,laptop,bob
203:1234:5678:9abc:def0:1234:5678:9abc,desktop,kermit
Each line represents a remote contact that will be advertised as local when reachable.
sudo ./ybb contacts.conf
or
doas ./ybb contacts.conf
The program will:
- Check connectivity every 10 seconds
- Start advertising when contact is reachable
- Stop advertising when contact goes offline
- Handle Ctrl+C gracefully for cleanup
On both machines.
- Enable Bonjour account
- Accounts -> Manage Accounts -> Add
- Protocol: Bonjour
- Username: somename
- Advanced tab: make sure port is 5298
-
Ensure Yggdrasil is running:
-
Run the bride
doas ./ybb contacts.conf
Do the same on the other machine.
- Check Pidgin on both machines Remote contact should appear in your Bonjour buddy list as if they were local!
Ping contact's Yggdrasil IP. Does it respond?
Then telnet to the contact's IPv6 and its port:
telnet yggip 5298
Can you connect?
If not, try to see if the other party's client actually listens on Yggdrasil IP. For example:
netstat -anp | grep pidgin
IMPORTANT: The other party's name in Pidgin (or other Bonjour client) should be the same as you have been written in your config file.
Other, not very important:
We have noticed that Adium does not listen on IPv6 addresses. :( So in theory if ybb gets ported to MacOS, Adium won't work anyway.
MacOS uses own dns-sd and not avahi, so this won't run on MacOS anyway. For now. If you know how to do the same we did by using avahi on MacOS, do a pull request, or open an issue and describe how.
As always, GPL-3.