[WIP] HTTP probing: support /tls/http multiaddrs #141
Closed
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.
HTTP probing: support /tls/http multiaddrs
According to libp2p specs, both
/https
and/tls/http
are valid multiaddr for HTTPS providers, but spark only tests/https
. This PR adds support for/tls/http
multiaddrs.Plan:
/tls/http
multiaddrs (initially failing)multiaddrToHttpUrl
function to handle/tls/http
patterns/tls/http
test casesChanges Made:
test/multiaddr.test.js
: Added 5 new test cases for/tls/http
multiaddr patterns:/ip4/127.0.0.1/tcp/443/tls/http
→https://127.0.0.1
/ip4/127.0.0.1/tcp/8080/tls/http
→https://127.0.0.1:8080
/dns/meridian.space/tcp/8080/tls/http
→https://meridian.space:8080
/dns/meridian.space/tls/http
→https://meridian.space
/ip4/127.0.0.1/tls/http
→https://127.0.0.1
lib/multiaddr.js
: Updated parsing logic to handle two/tls/http
patterns:/tls/http
(without TCP port) - treated as/https
/tcp/port/tls/http
- treated as/tcp/port/https
Verification:
/tls/http
test cases passFixes #139.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.