my question refers to the libp2p library in golang: https://github.com/libp2p/go-libp2p

rw
rw := bufio.NewReadWriter(bufio.NewReader(stream),bufio.NewWriter(stream))
,
message := rw.ReadString(rw)

As the peers are not all connected, they only receive messages from directly connected peers and not even all of them if there are multiple connections.

Exactly this problem is mentioned in the video, around time 09:45. The author of the video says that this could be easily modified to send messages not only to directly connected peers but also to multiple hosts. But how can this be done?

My goal is to send message from one peer and that all other peers in the network, also the not directly connected ones, can receive (and answer) it.