I am looking for a solution to send a message from an IPFS peer to another
in the github doc I found this code that connect a peer to another one :
ipfs.swarm.connect(addr, function (err) {
if (err) {
throw err
}
// if no err is present, connection is now open
})
but after connection there is nothing to do according to documentation.
There a solution named ipfs-pubsub-room that deal with messaging between peers, but there is no CDN for browser.
IPFS is a file system, so once you have two peers connected they can
addandgetfiles to share content between those nodes. If your "message" can be encoded as a file that node A adds (https://docs.ipfs.io/reference/api/cli/#ipfs-add) and node B gets (https://docs.ipfs.io/reference/api/cli/#ipfs-get), then they can exchange messages that way.Check out https://docs.ipfs.io/introduction/usage/ for general usage instructions.