Pubsub between go-ipfs and js-ipfs

I’m trying to build a system made of 2 nodes:

  1. go-ipfs node
  2. js-ipfs node inside a browser

The code for the POC is

You can start the go-ipfs with ./ and subscribe to the topic using ./
The browser startup and you can publish a message with pub button.

I was expecting this POC to work as it, but it doesn’t. It only works if I find the address of the go-ipfs using ipfs id and add it to the js-ipfs app. You can see the commented out lines of node.swarm.connect. Once I connect directly to that node it works and I can see the published message in the console window.

Also, I see that both nodes connect to at least one shared node in the swarm. I use ipfs swar addrs on the command line to list the swarm and the getId button actually list the js-ipfs node’s swarm. I thought having at least one common node means the pubsub message should arrive but it doesn’t look like that.

The whole point of using pubsub is to not know the exact address of the other node. Am I missing something or this scenario should not work?

Over a year later and I struggle with the same thing. I can get js-ipfs to pubsub to each other (I am using this signalling server). I see this post never got a response. Has anyone ever been able to get this to work? Is there a GitHub issue I can follow or should I create one? It seems like a reasonable requirement to have the two communicable after this long even though it is still considered experimental.