chr15m / bugout

Back end web app services over WebRTC.
https://chr15m.github.io/bugout
MIT License
603 stars 59 forks source link

Is there a way to pass in my own peer address to Bugout? Or.. #50

Closed draeder closed 3 years ago

draeder commented 3 years ago

Or, is there a way to retrieve the Bugout peer address before announcing to trackers, then announce later? I am interested in this for the tracker-swarm library I'm building. I need to be able to pass the peer ID to tracker-swarm first, then retrieve the list of trackers to announce to from tracker-swarm, then announce to Bugout. The peer ID tracker-swarm knows about needs to match when Bugout announces to those trackers.

draeder commented 3 years ago

I think I found a way to work around the need for this. As I'm inspecting things, the Bugout address is hashed anyway, so I can't use that address with tracker-swarm directly regardless.

What I can do, though, is use the peerId passed to the tracker when Bugout announces with b.on('torrent'). It will then need an additional http request from the browser after Bugout announces. But I think it will work okay for my use case and it should work with P2PT or similar, also.