Closed dominictarr closed 6 years ago
@dominictarr that was the idea for the external option flag to connections (https://github.com/ssbc/ssb-config#connections). This works both with domain names and tor onion addresses.
The local plugin is a bit of a thorn in the eye. Especially because I needed it to be backwards compatible and with getAddress as well.
Thinking about this some more i think we should do the following:
Add both private and public scope to default config. Change so that public can't be used for private here https://github.com/ssbc/multiserver/blob/master/index.js#L42
hmm, I'm also trying to get ssb-ws
to contribute it's address. so I expect to have an address that is ws://...;net:...
peers connecting to that would have a preference on wether they connected to net or ws, but web clients, for example, would connect to ws.
Yeah. You can actually just add a ws connection to scope "ws", then it is easy to getAddress it :-) The names are not hardcoded.
The reason why I wanted to make the change as mentioned above is that one might need a ws to create invites (scope public), but don't want ws to be used for local plugin connections (scope private).
I don't want to have to have a single option - I want for example, a scope with more than one address in it. Clients should decide which method they prefer. For example, socket/noauth is obviously the best, if you have access to it. Or you have a pub that can provide tor, net, and ws... so the clients can choose which is their preferred way to connect.
I'm gonna start this one again
I'm a bit confused by the scope thing. what i want:
I want a message that indicates your public address, but unlike the current "pub" messages, you should only speak for your self, not claim someone else's pub address. This would be used for pubs, and also, for peers behind tunnels, or introduced, etc...
so, basic pattern will be:
command to advertise public address: check your public address. (configured or detected) check if you have already posted a message about this. if yes, do nothing. If not, or the address has changed since then, then publish a message.
when creating a user invite, query for peers (which maybe be someone's pub) that follows you closely (in hops distance) that also has a public address. these are the peers which are likely to service the invite, so attach several of these to the code, say 3.
but poking around, on my laptop I get
"net:192.168.43.244:8008~shs:EMovhfIrFk4NihAKnRNhrfRaqIhBv1Wj8pTxJNgvCCY="
which is only a local network address... but on my pub, I get"net:128.199.132.182:8008~shs:DTNmX+4SjsgZ7xyDh5xxmNtFqa6pWi5Qtw7cE8aR9TQ="
which is good, that is a public address... but there is no way to tell from calling that method which sort of address it will be?For example: I want to advertise the 192.168... address on a local wifi, but not on a public feed, but the other one I want on a public feed. do we need more distinctions than just public and private?
@arj03 what do you think?