I wanted to make a decentralized social network on IPFS, but I encountered the problem of communication.
I suggest creating in Gateway the ability to create direct streams with peers. PubSub is no good for this.
How the feature should work
Web site makes a request to the gateway A to establish connection to the peer B. During connection establishment, authentication with the public key is performed.
To transfer data from the stream to the site, websocket is used, which contains packets with unique identifiers.