Skip to content

feat(nip66): add shared relay probe engine (DNS, TLS, WS RTT, NIP-11)#675

Open
Ferryx349 wants to merge 3 commits into
cameri:mainfrom
Ferryx349:NIP-66
Open

feat(nip66): add shared relay probe engine (DNS, TLS, WS RTT, NIP-11)#675
Ferryx349 wants to merge 3 commits into
cameri:mainfrom
Ferryx349:NIP-66

Conversation

@Ferryx349

Copy link
Copy Markdown
Collaborator

Description

This PR adds a shared relay probe engine for NIP-66 groundwork. It introduces runProbe(relayUrl) with structured per-check results for DNS, TLS, WebSocket open RTT, and NIP-11.

Related Issue

Fixes :- #669

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a812bfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls

coveralls commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 67.284% (-0.4%) from 67.674% — Ferryx349:NIP-66 into cameri:main

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a reusable relay probe engine (NIP-66 groundwork) that can run DNS, TLS, WebSocket open-RTT, and NIP-11 checks against a relay URL and return structured per-check results.

Changes:

  • Adds runProbe(relayUrl) with pluggable clients and per-check timing/status reporting.
  • Implements Node-backed probe clients for DNS, TLS, WebSocket RTT, and NIP-11 (with SSRF redirect guards).
  • Adds unit tests and a changeset for the new probing module.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/unit/utils/relay-probe.spec.ts Adds unit coverage for target parsing, safety checks, caching, and runProbe behavior.
src/utils/relay-probe/ws-rtt-probe.ts Implements a Node ws-based connector and WebSocket open-RTT probe.
src/utils/relay-probe/types.ts Defines probe result/status types and default timeout/cache constants.
src/utils/relay-probe/tls-probe.ts Implements a Node TLS connector and certificate probing logic.
src/utils/relay-probe/target.ts Parses relay URLs into normalized probe targets and detects network type.
src/utils/relay-probe/run-probe.ts Orchestrates parallel probe execution, DNS caching, and result shaping.
src/utils/relay-probe/nip11-probe.ts Implements NIP-11 fetch/validation with redirect safety checks.
src/utils/relay-probe/index.ts Exposes the probe engine public API (functions + types).
src/utils/relay-probe/dns-probe.ts Implements DNS record collection via Node DNS promises.
src/utils/relay-probe/dns-cache.ts Adds an in-memory DNS result cache with TTL expiration.
.knip.json Ignores the new probe module for knip unused-code checks.
.changeset/nip66-probe-engine.md Declares a minor release for the new probe engine feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/relay-probe/run-probe.ts
Comment thread src/utils/relay-probe/ws-rtt-probe.ts Outdated
Comment thread src/utils/relay-probe/nip11-probe.ts
Comment thread src/utils/relay-probe/dns-probe.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants