Skip to content

Conversation

Copilot
Copy link

@Copilot 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ done
Development

Successfully merging this pull request may close these issues.

HTTP probing: support /tls/http multiaddrs
2 participants