A critical tool for internet freedom activists to analyze connectivity to Iranian servers during internet restrictions
ابزاری حیاتی برای فعالان آزادی اینترنت جهت تحلیل اتصال به سرورهای ایرانی در زمان محدودیتهای اینترنتی
English: This tool helps identify data centers, CDNs, and DNS providers that can still connect to Iranian servers during international internet restrictions. It provides comprehensive analysis and tunnel recommendations for maintaining connectivity.
فارسی: این ابزار به شما کمک میکند دیتاسنترها، CDNها و ارائهدهندگان DNS را شناسایی کنید که در زمان محدودیتهای اینترنت بینالمللی همچنان میتوانند به سرورهای ایرانی متصل شوند. تحلیل جامع و پیشنهادهای تونلزنی برای حفظ ارتباط ارائه میدهد.
git clone https://github.com/ehsanking/iran-connectivity.git
cd iran-connectivity
apt install npm -yEnglish:
# install dependencies
npm install
# run test suite
npm test
# optional: install globally for `iran-check`
npm pack
npm install -g ./iran-check-1.0.0.tgzفارسی:
# نصب وابستگیها
npm install
# اجرای تستها
npm test
# اختیاری: نصب سراسری برای دستور `iran-check`
npm pack
npm install -g ./iran-check-1.0.0.tgzEnglish:
# Analyze connectivity to an Iranian IP
node cli.js analyze 185.185.123.45
# List all available providers
node cli.js providers
# Get tunnel recommendations
node cli.js recommend connectivity_report.json
# Show additional measurement tools for higher-accuracy testing
node cli.js toolkitفارسی:
# تحلیل اتصال به یک IP ایرانی
node cli.js analyze 185.185.123.45
# لیست تمام ارائهدهندگان
node cli.js providers
# دریافت پیشنهادهای تونلزنی
node cli.js recommend connectivity_report.jsonEnglish: 📖 Detailed English Tutorial - Complete guide with examples
فارسی: 📖 آموزش جامع فارسی - راهنمای کامل با مثال
English: Keep a service reachable when direct international paths are unstable by selecting a stable transit provider and an encrypted tunnel path.
فارسی: وقتی مسیر مستقیم بینالملل ناپایدار است، با انتخاب ترانزیت پایدار و تونل رمزنگاریشده سرویس را در دسترس نگه دارید.
# update system (Ubuntu/Debian)
sudo apt update && sudo apt -y upgrade
# install required tools
sudo apt install -y nodejs npm curl mtr-tiny traceroute netcat-openbsd
# open required firewall ports (example: tcp/443 and udp/51820)
sudo ufw allow 443/tcp
sudo ufw allow 51820/udp# on Iran server
node cli.js listener --protocol both --port 9000Then from an external probe/VPS:
# tcp probe
echo "ping" | nc <IRAN_SERVER_IP> 9000
# udp probe
echo "ping" | nc -u -w2 <IRAN_SERVER_IP> 9000# from probe host (outside Iran)
node cli.js analyze <IRAN_SERVER_IP> --detailed --timeout 10 --output transit_report.json
# optional recommendation extraction
node cli.js recommend transit_report.jsonSuggested order: WireGuard (UDP) → OpenVPN/SSH over TCP443 fallback.
Minimal WireGuard flow:
- Create WG server on transit VPS (outside Iran).
- Create WG client on Iran server.
- Route required traffic/subnets over WG interface only.
- Keep management SSH path separated (out-of-band if possible).
Run from probe host and Iran server:
# route visibility
traceroute <IRAN_SERVER_IP>
mtr -rwzc 20 <IRAN_SERVER_IP>
# connectivity analyzer
node cli.js analyze <IRAN_SERVER_IP> --detailed --timeout 15Check:
- packet loss is low and stable
- TCP/443 stays open
- same provider remains reachable across repeated tests
[User / Client]
|
v
[Transit VPS or CDN Edge]
(Turkey/UAE/Europe)
|
Encrypted Tunnel
(WireGuard / OpenVPN / SSH)
|
v
[Iran Server]
App + Listener + Service
Operational tip | نکته عملیاتی: Test at different times of day and keep at least one backup transit provider.
English:
# Basic analysis
node cli.js analyze <Iranian_IP>
# Detailed analysis with custom timeout
node cli.js analyze 185.185.123.45 --timeout 10 --detailed
# Export results to CSV
node cli.js analyze 185.185.123.45 --export csv --output results.csv
# Test with specific providers
node cli.js analyze 185.185.123.45 --providers "AWS,Google Cloud,Cloudflare"فارسی:
# تحلیل پایه
node cli.js analyze <IP_ایرانی>
# تحلیل دقیق با زمان انتظار سفارشی
node cli.js analyze 185.185.123.45 --timeout 10 --detailed
# خروجی گرفتن نتایج به CSV
node cli.js analyze 185.185.123.45 --export csv --output results.csv
# تست با ارائهدهندگان خاص
node cli.js analyze 185.185.123.45 --providers "AWS,Google Cloud,Cloudflare"English:
# List all providers with IP ranges
node cli.js providers
# Filter by region
node cli.js providers --region "middle-east"
# Get provider statistics
node cli.js providers --statsفارسی:
# لیست تمام ارائهدهندگان با رنجهای IP
node cli.js providers
# فیلتر بر اساس منطقه
node cli.js providers --region "middle-east"
# دریافت آمار ارائهدهندگان
node cli.js providers --statsEnglish:
# Show current configuration
node cli.js config show
# Set custom timeout
node cli.js config set timeout 15
# Add custom IP ranges
node cli.js config add-range "192.168.1.0/24" "Custom Provider"
# Reset to defaults
node cli.js config resetفارسی:
# نمایش پیکربندی فعلی
node cli.js config show
# تنظیم زمان انتظار سفارشی
node cli.js config set timeout 15
# افزودن رنجهای IP سفارشی
node cli.js config add-range "192.168.1.0/24" "Custom Provider"
# بازگشت به تنظیمات پیشفرض
node cli.js config resetEnglish:
# Start TCP + UDP listener on port 9000 (default)
node cli.js listener
# Start only TCP on a custom port
node cli.js listener --protocol tcp --port 8081
# Start only UDP on a custom host/port
node cli.js listener --protocol udp --host 0.0.0.0 --port 5353فارسی:
# اجرای لیسنر TCP و UDP روی پورت ۹۰۰۰ (پیشفرض)
node cli.js listener
# فقط TCP روی پورت دلخواه
node cli.js listener --protocol tcp --port 8081
# فقط UDP روی هاست/پورت دلخواه
node cli.js listener --protocol udp --host 0.0.0.0 --port 5353Quick probe examples | نمونه تست سریع
# TCP test (from client machine)
echo "ping" | nc <IRAN_SERVER_IP> 9000
# UDP test (from client machine)
echo "ping" | nc -u -w2 <IRAN_SERVER_IP> 9000English:
- 16+ Providers: AWS (65 ranges), Google Cloud (39), Azure (60), Cloudflare (93), Akamai (70), Fastly (52)
- DNS Services: Google DNS, Cloudflare DNS, OpenDNS, Quad9
- Regional Coverage: Iranian, Turkish, UAE, Qatari, Russian, Chinese data centers
- Total: 1000+ IP ranges
فارسی:
- ۱۶+ ارائهدهنده: AWS (۶۵ رنج)، Google Cloud (۳۹)، Azure (۶۰)، Cloudflare (۹۳)، Akamai (۷۰)، Fastly (۵۲)
- سرویسهای DNS: Google DNS، Cloudflare DNS، OpenDNS، Quad9
- پوشش منطقهای: دیتاسنترهای ایرانی، ترکیهای، اماراتی، قطری، روسی، چینی
- مجموع: بیش از ۱۰۰۰ رنج IP
English:
- Port Testing: 80, 443, 22, 53
- Connection Quality: Response time, packet loss, stability
- Network Analysis: Firewall detection, routing paths
- MTR Result: clear ✓ / ✗ status in detailed output (+ loss %)
فارسی:
- تست پورت: ۸۰، ۴۴۳، ۲۲، ۵۳
- کیفیت اتصال: زمان پاسخ، از دست دادن بسته، پایداری
- تحلیل شبکه: تشخیص فایروال، مسیرهای مسیریابی
- نتیجه MTR: نمایش واضح ✓ / ✗ در خروجی دقیق (بههمراه درصد loss)
English:
- Protocols: SSH, WireGuard, OpenVPN, Shadowsocks, V2Ray
- Transport Methods: TCP-over-TCP, UDP-over-TCP, WebSocket over TLS
- Confidence Scoring: 0-100% recommendation confidence
- Step-by-step Guides: Detailed setup instructions
فارسی:
- پروتکلها: SSH، WireGuard، OpenVPN، Shadowsocks، V2Ray
- روشهای انتقال: TCP-over-TCP، UDP-over-TCP، WebSocket over TLS
- امتیاز اطمینان: ۰-۱۰۰٪ اطمینان پیشنهاد
- راهنماهای گامبهگام: دستورالعملهای دقیق راهاندازی
English:
- Local Testing: All tests run locally on your server
- Encrypted Logs: Sensitive data is encrypted
- Rate Limiting: Prevents detection through excessive requests
- Minimal Footprint: Designed for stealth operation
فارسی:
- تست محلی: تمام تستها بهصورت محلی روی سرور شما اجرا میشود
- لاگهای رمزنگاری شده: دادههای حساس رمزنگاری میشوند
- محدودیت نرخ: جلوگیری از شناسایی از طریق درخواستهای زیاد
- ردپای کم: طراحی شده برای عملیات مخفی
| Command | Description | توضیح فارسی |
|---|---|---|
analyze <IP> |
Analyze connectivity to Iranian IP | تحلیل اتصال به IP ایرانی |
listener |
Start local TCP/UDP probe listener | اجرای لیسنر محلی TCP/UDP برای تست |
providers |
List all providers | لیست تمام ارائهدهندگان |
recommend <file> |
Get tunnel recommendations | دریافت پیشنهادهای تونلزنی |
config |
Configuration management | مدیریت پیکربندی |
| Option | Description | توضیح فارسی |
|---|---|---|
--timeout <seconds> |
Set timeout (default: 5) | تنظیم زمان انتظار (پیشفرض: ۵) |
--detailed |
Show detailed results | نمایش نتایج دقیق |
--export <format> |
Export format (json/csv/txt) | قالب خروجی |
--output <file> |
Output file path | مسیر فایل خروجی |
--providers <list> |
Filter providers | فیلتر ارائهدهندگان |
--region <region> |
Filter by region | فیلتر بر اساس منطقه |
English:
# Test with multiple custom parameters
node cli.js analyze 185.185.123.45 \
--timeout 15 \
--detailed \
--providers "AWS,Google Cloud,Cloudflare" \
--export json \
--output custom_test.json
# Batch testing
for ip in 185.185.123.45 185.185.123.46 185.185.123.47; do
node cli.js analyze $ip --export csv --output "test_$ip.csv"
doneفارسی:
# تست با چندین پارامتر سفارشی
node cli.js analyze 185.185.123.45 \
--timeout 15 \
--detailed \
--providers "AWS,Google Cloud,Cloudflare" \
--export json \
--output custom_test.json
# تست گروهی
for ip in 185.185.123.45 185.185.123.46 185.185.123.47; do
node cli.js analyze $ip --export csv --output "test_$ip.csv"
doneEnglish:
# Pipe to other tools
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.ports["443"] == true)'
# Use with cron for monitoring
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 -فارسی:
# اتصال به ابزارهای دیگر
node cli.js analyze 185.185.123.45 --export json | jq '.results[] | select(.ports["443"] == true)'
# استفاده با cron برای نظارت
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 -English:
{
"targetIp": "185.185.123.45",
"timestamp": "2024-01-15T10:30:00Z",
"summary": {
"totalProviders": 16,
"reachableProviders": 8,
"bestScore": 85,
"recommendedProvider": "Cloudflare"
},
"results": [
{
"provider": "Cloudflare",
"region": "Global",
"score": 85,
"status": "REACHABLE",
"ports": {
"80": true,
"443": true,
"22": false,
"53": true
},
"latency": 45,
"recommendedTunnel": "WireGuard-UDP"
}
]
}فارسی:
{
"targetIp": "185.185.123.45",
"timestamp": "2024-01-15T10:30:00Z",
"summary": {
"totalProviders": 16,
"reachableProviders": 8,
"bestScore": 85,
"recommendedProvider": "Cloudflare"
},
"results": [
{
"provider": "Cloudflare",
"region": "Global",
"score": 85,
"status": "REACHABLE",
"ports": {
"80": true,
"443": true,
"22": false,
"53": true
},
"latency": 45,
"recommendedTunnel": "WireGuard-UDP"
}
]
}English: This tool is designed for legitimate internet freedom research and activism. Users are responsible for complying with local laws and regulations. The developers assume no responsibility for misuse.
فارسی: این ابزار برای تحقیقات و فعالیتهای مشروع آزادی اینترنت طراحی شده است. کاربران مسئول رعایت قوانین و مقررات محلی هستند. توسعهدهندگان هیچ مسئولیتی در قبال سوءاستفاده نمیپذیرند.
English:
- Always test in a safe environment first
- Use encrypted connections for sensitive operations
- Monitor your network traffic
- Keep logs secure and encrypted
- Test during low-traffic periods
فارسی:
- همیشه ابتدا در یک محیط امن تست کنید
- برای عملیات حساس از اتصالات رمزنگاری شده استفاده کنید
- ترافیک شبکه خود را نظارت کنید
- لاگها را امن و رمزنگاری شده نگه دارید
- در زمانهای کمترافیک تست کنید
Git merge conflict (<<<<<<<, =======, >>>>>>>)
English: merge fails when unresolved conflict markers remain in source files (for example cli.js). Keep one final version of the conflicted block, remove all markers, then run:
npm test
node -c cli.jsفارسی: اگر markerهای conflict داخل کد باقی مانده باشند (مثلاً در cli.js) عملیات merge شکست میخورد. فقط نسخه نهایی بلاک را نگه دارید، markerها را کامل حذف کنید، سپس اجرا کنید:
npm test
node -c cli.jsEnglish:
# Permission denied
chmod +x cli.js
# Module not found
npm install
# Timeout errors
node cli.js analyze <IP> --timeout 20
# No connectivity
Check your server's internet connectionفارسی:
# مجوز دسترسی
chmod +x cli.js
# ماژول یافت نشد
npm install
# خطاهای تایماوت
node cli.js analyze <IP> --timeout 20
# بدون اتصال
اتصال اینترنت سرور خود را بررسی کنیدEnglish: We welcome contributions from the community. Please submit pull requests or open issues for bugs and feature requests.
فارسی: ما از مشارکت جامعه استقبال میکنیم. لطفاً درخواستهای pull ارسال کنید یا برای باگها و درخواستهای ویژگی، issues باز کنید.
English: For questions and support, please open an issue on GitHub.
فارسی: برای سوالات و پشتیبانی، لطفاً در GitHub یک issue باز کنید.
English: This project is licensed under the MIT License - see the LICENSE file for details.
فارسی: این پروژه تحت مجوز MIT منتشر شده است - برای جزئیات فایل LICENSE را ببینید.
English: This tool is dedicated to all internet freedom activists for free access to information.
فارسی: این ابزار به تمام فعالان آزادی اینترنت تقدیم شده است.
⭐ Star this repository if you find it helpful! ⭐ اگر این مخزن برای شما مفید بود، آن را ستارهدار کنید!