Skip to content

Conversation

@regular
Copy link
Contributor

@regular regular commented Jul 24, 2021

Hey!
Since multiserver 3.7.0 was published I ran into an issue using ssb-client from within a browser context. ssb-client is instanciating multiserver's unix-sockets plugin regardless of whether it is needed to connect to the given remote or not. This used to be fine until multiserver 3.7.0, where, during initialisation of that plugin, a fs function is called that is not replaced by browserify's brfs (mkdtmpSync). While this could be fixed in multiserver, I decided to atteck the root problem instead.

This PR builds a custom Multiserver instance that only instanciates the plugins that are mentioned on the remote address that we want to connect to. It still only allows for the transport/protocol combinations that were previously hardcoded.

What do you think?

@regular
Copy link
Contributor Author

regular commented Aug 5, 2021

@arj03 @mixmix @christianbundy any thoughts?

@arj03
Copy link
Member

arj03 commented Aug 5, 2021

Looks good to me. This seems like a good improvement overall.

@mixmix
Copy link
Member

mixmix commented Aug 5, 2021 via email

@regular
Copy link
Contributor Author

regular commented Oct 15, 2021

@mixmix Right, there's no test that actually tries the different ways the client can connect to the server. I tried to write one, but failed miserable after way to many hours ... I just can't get one of these two options to work:

a) an ssb-server instance that listens on all legal combinations of transport/transforms
b) a series of ssb-servers that each listen on ONE legal combination of transport/transform

a) fails because multiserver cannot have more than one unix incoming at a time (but unix/shs and unix/noauth are both needed in the test), because they end up having the same filesystem path (ssb.config.path is reused here)

b) fails because, for some reason I don't understand, even two distinct instances of ssb-server, that are started in sequence and whose lifespans do not overlap, cannot each create a unix socket (in this scenario the paths even are different)

And finally: I just can't get the onion stuff to work. Could you help out with the test? @cryptix @arj03

@mixmix
Copy link
Member

mixmix commented Oct 15, 2021

Alternative idea that's not a breaking change.

Have an option which enables this mode of yours. And if it's not enabled it behaves as it currently does

That way you can get this merged and we can all stress test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants