Use pubsub between browser node and go-ipfs (daemon) node

Hello everyone.

I’ve been experiencing some issues using the pubsub feature between a browser node and a go-ipfs daemon running on my local machine.

First I tried to setup a direct connection between the nodes. But I always get the same error on the browser console:

Then I tried setting up a p2p network between the 2 nodes. I assume I did manage to get the circuit going since browser logged:

Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/4001/ipfs/QmPMaDyK2ee95BpjnMyWYiVi46EcZFrY8AUmSzieNSLbEa/ipfs/QmcCnVBpYLvcRLbutwRMkzeJwHfjbFaq8y9JQ2sLcBAX1L

The first ID on that string is the daemon ID, the second one is the browser ID.

After that I attempted to publish the message from the browser, using the pubsub API, and I had the daemon subscribe to the corresponding topic.

However, the daemon does not get the message sent by the browser. Nothing appears in the terminal after subscribing.

So basically I would like to know if it is possible to get pubsub working between this 2 different types of nodes. And if it is possible, what are the correct configs for both nodes?

For more information about the project I’m working on and the configuration that we’re using check out this issue: https://github.com/open-science-org/idea-hub/issues/10

Thank you very much!