Closed satoshi999 closed 1 year ago
I'm having a similar issue ipfs/js-kubo-rpc-client#70
@threshold862543 It issue seems that my case is different from this issue
This issue as linked describes the behavior when accessing by http from a browser using ipfs-http-client to a local node. The pubsub keyword is used, but it seems irrelevant since it is ipfs-http-client
I understand that in my case it is an issue related to the pubsub communication between IPFS node in the browser and the daemon node, In other words, it seems to be a websockets communication issue between the browser node and the daemon node
Hello @satoshi999,
js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and the corresponding migration guide here.
As a result, we are going to close this issue. If you think we have done this in error, please feel to reopen with any comments in the next week as we will circle back on the reopened issues.
We hope you will consider Helia for your IPFS in JS needs. If you believe this particular request belongs in Helia, feel free to open a Helia issue. We look forward to engaging with you more there.
Thanks, @ipfs/helia-dev
I tried to sending pubsub message from Browser node to terminal node via websockets with following code. It seems that has succeeded connection via websockets because opponent node id is in peer list But, it can not receive pubsub message.
Is it possible that sending pubsub message between browser and terminal node?
On browser side.
window.addEventListener('load', async() => { const ipfs = await create({ repo:'IPFS-' + Math.random(), libp2p: { transports: [new WebSockets({filter:all})], config: { pubsub: { emitSelf:false } } } })
await ipfs.swarm.connect('/ip4/127.0.0.1/tcp/4003/ws/p2p/QmVpoLX9Us7AF39vWsFFHSz274ShJfHaVY5VWoVsuAzpdb')
await ipfs.pubsub.subscribe('message', (msg)=> { const data = new TextDecoder().decode(msg.data) console.log(data) })
const id = await (await ipfs.id()).id
setInterval(async() => { await ipfs.pubsub.publish('message', new TextEncoder().encode(
Hello from ${id}
))}, 1000) })