Skip to content

Add local TCP/UDP probe listener and MTR diagnostics to CLI and analysis#20

Merged
ehsanking merged 1 commit intomainfrom
ehsan/create-tcp/udp-connectivity-listener-kra6k6
Apr 2, 2026
Merged

Add local TCP/UDP probe listener and MTR diagnostics to CLI and analysis#20
ehsanking merged 1 commit intomainfrom
ehsan/create-tcp/udp-connectivity-listener-kra6k6

Conversation

@ehsanking
Copy link
Copy Markdown
Owner

Motivation

  • Provide an on-server TCP/UDP echo listener to help Iran-side probing without extra packages and surface MTR-based connectivity health in analysis output.
  • Improve connectivity scoring and reporting by incorporating a lightweight MTR check (loss %) to better indicate path quality.
  • Update documentation to show listener usage examples and clarify MTR results in outputs and examples.

Description

  • Implemented a startProbeListener helper and new listener CLI command in cli.js to run TCP and/or UDP echo listeners using net and dgram, with --host, --port, and --protocol options.
  • Added MTR execution and parsing to iran_connectivity.js by introducing mtrAvailable, mtrLossPercent, mtrRawSample, and updating stageResults.mtr and the connectivity scoring logic to award points based on loss thresholds.
  • Updated CLI reporting in cli.js to display an MTR badge and loss percent in summary and per-provider details, and added the listener and MTR notes to README.md including example commands and quick probe snippets.
  • Minor README examples adjusted (e.g. jq example filtering by ports["443"]) and the command reference now lists listener.

Testing

  • Ran the repository automated test suite with npm test and the suite completed successfully.
  • Ran the project's linter/formatting checks via npm run lint which passed without errors.
  • Executed the CLI smoke test node cli.js --help in CI to validate command registration and it succeeded.

Codex Task

@ehsanking ehsanking merged commit 077dc90 into main Apr 2, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0fff919e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

console.log(chalk.green('\n✅ Successful providers:'));
results.successfulProviders.forEach((provider, index) => {
console.log(` ${index + 1}. ${provider.name} (score: ${provider.bestScore})`);
const badge = mtrBadge(provider.bestConnection);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep bestConnection when rendering MTR provider summary

In printDetailedReport, the successful-provider summary now derives the MTR badge/loss from provider.bestConnection, but entries in results.successfulProviders are populated without a bestConnection field (they only carry provider/name/count/score in runAnalysis). When --detailed output is shown, this makes every successful provider display MTR: ✗, loss: N/A regardless of real MTR results, so the newly added MTR summary is systematically incorrect.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant