Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

[WIP] HTTP probing: support /tls/http multiaddrs#141

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-139
Closed

[WIP] HTTP probing: support /tls/http multiaddrs#141
Copilot wants to merge 1 commit intomainfrom
copilot/fix-139

Conversation

Copy link

Copilot AI commented Aug 12, 2025

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:

  • Explore repository structure and understand codebase
  • Set up Zinnia runtime and run existing tests
  • Analyze current multiaddr parsing implementation
  • Add test cases for /tls/http multiaddrs (initially failing)
  • Update multiaddrToHttpUrl function to handle /tls/http patterns
  • Verify all tests pass including new /tls/http test cases
  • Run linting and ensure code style compliance
  • Manual verification of functionality and edge cases

Changes Made:

  • test/multiaddr.test.js: Added 5 new test cases for /tls/http multiaddr patterns:

    • /ip4/127.0.0.1/tcp/443/tls/httphttps://127.0.0.1
    • /ip4/127.0.0.1/tcp/8080/tls/httphttps://127.0.0.1:8080
    • /dns/meridian.space/tcp/8080/tls/httphttps://meridian.space:8080
    • /dns/meridian.space/tls/httphttps://meridian.space
    • /ip4/127.0.0.1/tls/httphttps://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:

  • All existing tests continue to pass (no regressions)
  • All new /tls/http test cases pass
  • Manual testing confirms correct HTTPS URL generation
  • Edge cases properly fail with appropriate error messages
  • Code passes linting and style checks

Fixes #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.

Copy link
Author

Copilot AI commented Aug 12, 2025

@bajtos 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: ✅ done

Development

Successfully merging this pull request may close these issues.

HTTP probing: support /tls/http multiaddrs

2 participants