mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-06-12 21:21:41 +00:00
feat: relay filtering
* feat: filter IPFS addrs correctly * feat: mafmt addrs now support /ipfs no need for ad-hoc filtering * feat: skip p2p-circuit addresses
This commit is contained in:
committed by
David Dias
parent
7572279838
commit
11c4f451f4
@ -67,10 +67,16 @@ class TCP {
|
||||
if (!Array.isArray(multiaddrs)) {
|
||||
multiaddrs = [multiaddrs]
|
||||
}
|
||||
|
||||
return multiaddrs.filter((ma) => {
|
||||
if (includes(ma.protoNames(), 'p2p-circuit')) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (includes(ma.protoNames(), 'ipfs')) {
|
||||
ma = ma.decapsulate('ipfs')
|
||||
}
|
||||
|
||||
return mafmt.TCP.matches(ma)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user