You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I use this extension or ut_metadata or by creating a new one to be able to send messages to other peer (chat message) ?
I just started by creating a new extension which i am thinking of integrating that into webtorrent. So I modified torrent.js (inside webtorrent, ln 463) - _onWire callback - this block is same as that of ut_pex.
if(typeofut_message==='function'){wire.use(ut_message())//wire.ut_message.start() // TODO two-way communicationwire.ut_message.on('peer',function(peer){debug('ut_message: got peer: %s (from %s)',peer,addr)self.addPeer(peer)})wire.ut_message.on('dropped',function(peer){// the remote peer believes a given peer has been dropped from the swarm.// if we're not currently connected to it, then remove it from the swarm's queue.debug('ut_message: dropped peer: %s (from %s)',peer,addr)varpeerObj=self.swarm._peers[peer]if(!peerObj||!peerObj.conn)self.swarm.removePeer(peer)})}
Is it required? Or i can just use any extension (ut_metadata, ut_pex or mine - ut_message) as:
torrent.swarm.on("wire",function(wire){console.log("onwire - "+wire.peerId+" - "+wire.remoteAddress+':'+wire.remotePort);wire.on('extended',function(ext,obj){console.log('extended',ext,obj.toString());});wire.use(ut_message());//orwire.use(ut_metadata());//orwire.use(ut_pex());wire.extended(3,'hello');//first param will be either 1, 2 or 3});
The text was updated successfully, but these errors were encountered:
How can I use this extension or ut_metadata or by creating a new one to be able to send messages to other peer (chat message) ?
I just started by creating a new extension which i am thinking of integrating that into webtorrent. So I modified torrent.js (inside webtorrent, ln 463) - _onWire callback - this block is same as that of ut_pex.
Is it required? Or i can just use any extension (ut_metadata, ut_pex or mine - ut_message) as:
The text was updated successfully, but these errors were encountered: