This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
Suppress libp2p:ip-port-to-multiaddr:err invalid ip:port for creating a multiaddr
#147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running https://github.com/libp2p/js-libp2p/tree/master/examples/webrtc-direct with Firefox, the connection fails due to the following error:
This is due to the fact that
toMultiaddr
throws an error becausesocket.localAddress
is a fqdn, not an ip (c67a8623-319c-4b31-96fa-e35c6b25a83a.local
). It works fine in Chromium becausesocket.localAddress
is undefined.I contemplated the option to still attempt building an address out of the local fqdn. However, it does not seem possible to know whether it is an ip4 or ip6 address.
socket
haslocalFamily
that containsIPv4
in my tests. However, the way it is set is unreliable for fqdn:https://github.com/ipfs-shipyard/simple-peer/blob/1039b90f91fc8e91492ff1af52f9fc9bfff97c35/index.js#L773
Note: tested with https://github.com/libp2p/js-libp2p/tree/master/examples/webrtc-direct?rgh-link-date=2022-02-28T04%3A20%3A39Z