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
/dnsaddr is handled as /dns4 in libp2p-websocket and libp2p-websocket-websys. This is incorrect because /dnsaddr is only for quering _dnsaddr.domain from DNS.
/dnsaddr support in WebSocket is tracked in #5529.
Hey! Interesting find. I would have always assumed that using dnsaddr in this manner for websocket is fine but it does make sense that it would be meant to query the dns record itself.
## Description
Returns `Error::InvalidMultiaddr` when `parse_ws_dial_addr` is called
with `/dnsaddr`.
As per its specification, `/dnsaddr` domains are not meant to be
directly dialed, instead it should be appended with `_dnsaddr.` and used
for DNS lookups afterwards
Related: libp2p#5529Fixes: libp2p#5601
## Notes & open questions
* Is it okay to return an error, or should I perform a DNS lookup and
resolve that DNS afterwards if address has `/dnsaddr`?
* If so, how should I handle that case where DNS lookup returns multiple
multiaddrs?
## Change checklist
- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
---------
Co-authored-by: Darius Clark <[email protected]>
Summary
/dnsaddr
is handled as/dns4
inlibp2p-websocket
andlibp2p-websocket-websys
. This is incorrect because/dnsaddr
is only for quering_dnsaddr.domain
from DNS./dnsaddr
support in WebSocket is tracked in #5529.libp2p-websocket:
rust-libp2p/transports/websocket/src/framed.rs
Lines 511 to 516 in a2a2816
libp2p-websocket-websys:
rust-libp2p/transports/websocket-websys/src/lib.rs
Lines 131 to 136 in a2a2816
Expected behavior
TransportError::MultiaddrNotSupported
should be returned fromdial
.Actual behavior
/dnsaddr
multiaddress is dialed as if it was/dns4
.Relevant log output
No response
Possible Solution
No response
Version
0.54.1
Would you like to work on fixing this bug ?
Maybe
The text was updated successfully, but these errors were encountered: