We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
even though two peers don't share a same room, the still get connected via Libp2p.
how to reproduce run the code in new terminal run the same code but change the room topic
const Room = require("ipfs-pubsub-room"); const Libp2p = require("libp2p"); const MPLEX = require("libp2p-mplex"); const SECIO = require("libp2p-secio"); const PUBSUB = require("libp2p-floodsub"); const WebRTCStar = require("libp2p-webrtc-star"); const TCP = require("libp2p-tcp"); const wrtc = require("wrtc"); const main = async () => { try { const libp2p = await Libp2p.create({ modules: { transport: [TCP, WebRTCStar], connEncryption: [SECIO], streamMuxer: [MPLEX], pubsub: PUBSUB, }, config: { transport: { WebRTCStar: { wrtc, }, }, }, }); const webrtcAddr = "/dns4/quiet-lowlands-16063.herokuapp.com/tcp/443/wss/p2p-webrtc-star/"; libp2p.peerInfo.multiaddrs.add(webrtcAddr); await libp2p.start(); console.log(`libp2p id is ${libp2p.peerInfo.id.toB58String()}`); libp2p.on("peer:connect", () => { console.log("peer connected"); }); libp2p.on("peer:disconnect", () => { console.log("peer disconnected"); }); const room = new Room(libp2p, "room-name"); room.on("peer joined", (peer) => { console.log("Peer joined the room", peer); }); room.on("peer left", (peer) => { console.log("Peer left...", peer); }); // now started to listen to room // this never gets fired room.on("subscribed", () => { console.log("Now connected!"); }); } catch (error) { console.log("error", error); } }; main();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
even though two peers don't share a same room, the still get connected via Libp2p.
how to reproduce
run the code
in new terminal run the same code but change the room topic
The text was updated successfully, but these errors were encountered: