Skip to content

Commit 077dc90

Browse files
authored
Merge pull request #20 from ehsanking/ehsan/create-tcp/udp-connectivity-listener-kra6k6
Add local TCP/UDP probe listener and MTR diagnostics to CLI and analysis
2 parents d962856 + b0fff91 commit 077dc90

1 file changed

Lines changed: 40 additions & 4 deletions

File tree

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,41 @@ node cli.js config add-range "192.168.1.0/24" "Custom Provider"
158158
node cli.js config reset
159159
```
160160

161+
### 4. Iran-side Local Listener (No extra package) | لیسنر محلی سمت ایران (بدون پکیج اضافه)
162+
163+
**English:**
164+
```bash
165+
# Start TCP + UDP listener on port 9000 (default)
166+
node cli.js listener
167+
168+
# Start only TCP on a custom port
169+
node cli.js listener --protocol tcp --port 8081
170+
171+
# Start only UDP on a custom host/port
172+
node cli.js listener --protocol udp --host 0.0.0.0 --port 5353
173+
```
174+
175+
**فارسی:**
176+
```bash
177+
# اجرای لیسنر TCP و UDP روی پورت ۹۰۰۰ (پیشفرض)
178+
node cli.js listener
179+
180+
# فقط TCP روی پورت دلخواه
181+
node cli.js listener --protocol tcp --port 8081
182+
183+
# فقط UDP روی هاست/پورت دلخواه
184+
node cli.js listener --protocol udp --host 0.0.0.0 --port 5353
185+
```
186+
187+
**Quick probe examples | نمونه تست سریع**
188+
```bash
189+
# TCP test (from client machine)
190+
echo "ping" | nc <IRAN_SERVER_IP> 9000
191+
192+
# UDP test (from client machine)
193+
echo "ping" | nc -u -w2 <IRAN_SERVER_IP> 9000
194+
```
195+
161196
---
162197

163198
## 📊 Features | ویژگی‌ها
@@ -182,13 +217,13 @@ node cli.js config reset
182217
- **Port Testing**: 80, 443, 22, 53
183218
- **Connection Quality**: Response time, packet loss, stability
184219
- **Network Analysis**: Firewall detection, routing paths
185-
- **Scoring System**: 0-100 connectivity score
220+
- **MTR Result**: clear ✓ / ✗ status in detailed output (+ loss %)
186221

187222
**فارسی:**
188223
- **تست پورت**: ۸۰، ۴۴۳، ۲۲، ۵۳
189224
- **کیفیت اتصال**: زمان پاسخ، از دست دادن بسته، پایداری
190225
- **تحلیل شبکه**: تشخیص فایروال، مسیرهای مسیریابی
191-
- **سیستم امتیازدهی**: امتیاز اتصال ۰-۱۰۰
226+
- **نتیجه MTR**: نمایش واضح ✓ / ✗ در خروجی دقیق (به‌همراه درصد loss)
192227

193228
### Tunnel Recommendations | پیشنهادهای تونل‌زنی
194229

@@ -229,6 +264,7 @@ node cli.js config reset
229264
| Command | Description | توضیح فارسی |
230265
|---------|-------------|-------------|
231266
| `analyze <IP>` | Analyze connectivity to Iranian IP | تحلیل اتصال به IP ایرانی |
267+
| `listener` | Start local TCP/UDP probe listener | اجرای لیسنر محلی TCP/UDP برای تست |
232268
| `providers` | List all providers | لیست تمام ارائه‌دهندگان |
233269
| `recommend <file>` | Get tunnel recommendations | دریافت پیشنهادهای تونل‌زنی |
234270
| `config` | Configuration management | مدیریت پیکربندی |
@@ -287,7 +323,7 @@ done
287323
**English:**
288324
```bash
289325
# Pipe to other tools
290-
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.score > 70)'
326+
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.ports["443"] == true)'
291327

292328
# Use with cron for monitoring
293329
echo "0 2 * * * cd /path/to/irancheck && node cli.js analyze 185.185.123.45 --export json --output daily_\$(date +\%Y\%m\%d).json" | crontab -
@@ -296,7 +332,7 @@ echo "0 2 * * * cd /path/to/irancheck && node cli.js analyze 185.185.123.45 --ex
296332
**فارسی:**
297333
```bash
298334
# اتصال به ابزارهای دیگر
299-
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.score > 70)'
335+
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.ports["443"] == true)'
300336

301337
# استفاده با cron برای نظارت
302338
echo "0 2 * * * cd /path/to/irancheck && node cli.js analyze 185.185.123.45 --export json --output daily_\$(date +\%Y\%m\%d).json" | crontab -

0 commit comments

Comments
 (0)