arj03 / ssb-browser-core

ssb-server in a browser
Other
50 stars 8 forks source link

a question -- how to get a list of connections #51

Closed nichoth closed 3 years ago

nichoth commented 3 years ago

How does one get a list of everything you are connected to? rooms & pubs & local peers if applicable (i'm not sure how ssb-browser-core does it).

arj03 commented 3 years ago

Have a look at connections in browser-demo. Basically it just uses the API from ssb-conn (SSB.net.conn).

nichoth commented 3 years ago

Thanks @arj03 . So in conn, there is this recipe for getting all currently connected peers. And a peer in this context means someone we are connected to directly, vs a 'pub', which you connect to but just relays messages from peers.

Does the browser version of ssb have the concept of invites & pubs, or is it just 'rooms'?

arj03 commented 3 years ago

conn: yes

It supports pubs and rooms and also "direct" connections over DHT. Invites are not supported as I'm of the opinion that they don't make sense in SSB main. They might make sense if you use a different cap, but that is a different story. So I'm not against adding it, just havn't seen a good use case.