Author SHA1 Message Date
jschoubben 4ef41ad5a0 Merge pull request 'A host logs in as node.<name> and hears answers on its own inbox' (#35) from fix/a-host-uses-its-own-inbox into main 2026-09-27 23:18:30 +00:00
jschoubben d749de989c A host hears the server's answers on its own inbox
The mesh grants a machine exactly its own inbox prefix; the client used the
default one and was refused a subscription to it.
2026-09-28 01:16:23 +02:00
+3
View File
@@ -74,6 +74,9 @@ func dialNats(ctx context.Context, m Membership, timeout time.Duration) (Link, e
// the server refused the bare name the first time a machine dialled it: "authentication // the server refused the bare name the first time a machine dialled it: "authentication
// error - User". The same string the mesh composed into the user list, or nothing connects. // error - User". The same string the mesh composed into the user list, or nothing connects.
nats.UserInfo("node."+m.Node, m.Password), nats.UserInfo("node."+m.Node, m.Password),
// Replies to what this client asks the server arrive on its inbox, and the mesh grants a
// machine exactly its own: the same prefix the user list was composed with.
nats.CustomInboxPrefix("_INBOX.node." + m.Node),
nats.Name("mesh-host/" + m.Node), nats.Name("mesh-host/" + m.Node),
nats.Timeout(timeout), nats.Timeout(timeout),
// A node that has silently lost its route notices, rather than holding a connection the // A node that has silently lost its route notices, rather than holding a connection the