Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

feat: skip p2p-circuit addresses #61

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"Jack Kleeman <jackkleeman@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>"
]
}
}
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ class WebSockets {
}

return multiaddrs.filter((ma) => {
if (includes(ma.protoNames(), 'ipfs')) {
if (includes(ma.protoNames(), 'p2p-circuit')) {
return false
} else if (includes(ma.protoNames(), 'ipfs')) {
ma = ma.decapsulate('ipfs')
}

return mafmt.WebSockets.matches(ma) || mafmt.WebSocketsSecure.matches(ma)
})
}
Expand Down