feat(nip66): add shared relay probe engine (DNS, TLS, WS RTT, NIP-11)#675
Open
Ferryx349 wants to merge 3 commits into
Open
feat(nip66): add shared relay probe engine (DNS, TLS, WS RTT, NIP-11)#675Ferryx349 wants to merge 3 commits into
Ferryx349 wants to merge 3 commits into
Conversation
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
🦋 Changeset detectedLatest commit: a812bfc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Collaborator
There was a problem hiding this comment.
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.
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
Checklist: