Skip to content

Conversation

marten-seemann
Copy link
Contributor

No description provided.

func ContainsSecurityProtocol(addr Multiaddr) bool {
var contains bool
ForEach(addr, func(c Component) bool {
if code := c.Protocol().Code; code == P_TLS || code == P_NOISE {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I would definitely put this in an extendable map.
  • This is also somewhat ambiguous. For example, what about wss? What about quic? This kind of check will likely fit better in the swarm itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I would definitely put this in an extendable map.

Makes sense.

  • This is also somewhat ambiguous. For example, what about wss? What about quic? This kind of check will likely fit better in the swarm itself.

True, this should probably be better documented.
I'm not sure if putting it in the swarm is the right solution though. We'll need a function like this (maybe a SecurityProtocol(Multiaddr) string is even better?) in quite a lot of packages, especially as we'll have a lengthy transition period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants