ssbc / go-ssb

Go implementation of ssb (work in progress!)
https://scuttlebutt.nz
161 stars 26 forks source link

refactor network code #38

Open cryptix opened 4 years ago

cryptix commented 4 years ago

Right now we can only listen on ONE network address for incoming connections. It would be rad to have multiple ones with different connTrackers (localhost with no limits, public with only one connection per pubkey, for instance)

Another limiting factor is that for mobile applications, the listeners might need to be suspended and resumed, also with changing addresses.

cryptix commented 4 years ago

I tried this 6 month ago on this branch but was on too many other daedlines to pull through.

The intermediate solution that is merged is that you can call sbot.Server() multiple times and it re-opens the listener.

cryptix commented 3 years ago

There is a lot of copied code from this project in https://github.com/ssb-ngi-pointer/go-ssb-room now. It's mostly in internal, thought but that might be a good experiment to find a line to cut out a re-usable module between the two.

I guess this would be the Go equivalent of secret-stack, but most likely without the plugin system.