-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
fix: Rewrite to interpret multiaddr from right to left #120
Conversation
Tests will fail until multiformats/js-multiaddr#312 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a small change needed.
Also, do we need to add anything to handle the snazzy new webtransport/webrtc/webrtc-direct transports?
No, they don't use this library. |
## [9.0.5](v9.0.4...v9.0.5) (2023-05-19) ### Bug Fixes * Rewrite to interpret multiaddr from right to left ([#120](#120)) ([681d4e3](681d4e3))
🎉 This PR is included in version 9.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I wanted to support
/tls/ws
,/tls/http
, and/tls/sni/example.com/http
. Unfortunately the existing code interprets these multiaddrs left to right in a reduce loop. These multiaddrs (and multiaddrs in general) need to be parsed right to left. This refactors the code to so that it is interpreted right to left.It's a bit verbose, but straightforward.
This is somewhat blocked on multiformats/js-multiaddr#312 (Not strictly blocked, but would be good to bump the dep when that is merged).
This is needed because js-libp2p-websockets uses this library, and without this we can't dial addresses that use
/tls/ws
or/tls/sni/example.com/ws...