ماذا تفعل الأداة
proxy-probe.mjs يأخذ القائمة من رابط أو ملف ويطلب عبر كل سطر صفحة judge، أي موقعًا يعيد ترويسات الطلب الذي تلقاه. تعطي الإجابة ثلاث حقائق عن البروكسي: هل يعمل، وكم استغرق الطلب، وأي IP رآه الموقع.
- صيغ الأسطر:
ip:portوhost:port:login:passwordوlogin:password@host:port. تحدد البادئةhttp://أوsocks5://بروتوكول السطر الواحد. - تُفسَّر كلمة المرور التي تحتوي على نقطتين أو @ بشكل صحيح. يحذف السكربت التكرار ويتخطى الأسطر الفارغة والأسطر خارج الصيغة.
- يفحص السكربت 150 بروكسي في وقت واحد وينتظر كلًا منها 8 ثوانٍ على الأكثر، فتكفي دقيقة لألف سطر. يتغير الرقمان بالمعاملات.
- يحصل كل بروكسي عامل على تقييم إخفاء: high أو medium أو none.
- البروكسي الذي أجاب لكنه رفض اسم المستخدم أو كلمة المرور يدخل في عداد منفصل لا في الميتة.
- تستقر الأسطر العاملة في
alive.txtكما هي، من الأسرع إلى الأبطأ، والملف جاهز فورًا لبرنامجك. يضيف المعامل--csvتقريرًا بزمن الاستجابة وعنوان الخروج ومستوى الإخفاء.
تحتاج إلى Node.js 18 أو أحدث. لا توجد حزم خارجية، بل وحدات مدمجة فقط، والكود كله في ملف واحد. لا تذهب قائمتك إلى أي مكان: يتصل السكربت فقط بالبروكسيات في القائمة وبصفحة judge.
التنزيل والتشغيل بأمر واحد
الرابط المباشر للملف:
تنزيل proxy-probe.mjshttps://proxymix.net/res/files/proxy-probe.mjs
Linux وmacOS: ينزّل الأمر الملف في المجلد الحالي ويبدأ الفحص فورًا.
wget -qO proxy-probe.mjs https://proxymix.net/res/files/proxy-probe.mjs && node proxy-probe.mjs list.txtالأمر نفسه عبر curl إن لم يكن wget على الخادم:
curl -fsSLo proxy-probe.mjs https://proxymix.net/res/files/proxy-probe.mjs && node proxy-probe.mjs list.txtدون حفظ الملف: يمرر curl السكربت مباشرة إلى Node، وتأتي الوسائط بعد الشرطة.
curl -fsSL https://proxymix.net/res/files/proxy-probe.mjs | node --input-type=module - list.txtبدل list.txt ضع ملفك أو رابط القائمة.
طرق التشغيل
الباقة غير المحدودة: رابط قائمة ip:port من لوحة التحكم، دون .csv في آخره، لأن الأداة لا تقرأ الجدول. أبقِ --parallel أقل من عدد خيوط الباقة، وإلا رُفضت الاتصالات الزائدة ودخلت الأسطر العاملة في الميتة.
node proxy-probe.mjs "https://YOUR_LIST_LINK" --parallel 100الخطط بالـ GB: ملف بأسطر host:port:login:password. افحص أسطر SOCKS5 مع --kind socks5.
node proxy-probe.mjs http-lines.txt
node proxy-probe.mjs socks-lines.txt --kind socks5البروكسيات المجانية: في القائمة الطويلة أسطر ميتة كثيرة. ارفع التوازي وقصّر الانتظار واترك من التقرير تقييم high فقط.
node proxy-probe.mjs free.txt --parallel 400 --wait 4 --csv report.csv
grep ',high$' report.csv | cut -d, -f1 > high.txtتقرير لجدول: يفتح CSV في Excel وGoogle Sheets، بالأعمدة proxy وms وexit_ip وanonymity.
node proxy-probe.mjs list.txt --output ok.txt --csv report.csvصفحة judge خاصة بك، إن كان httpbin.org بطيئًا أو مغلقًا في شبكتك. يصلح أي عنوان http عادي يطبع ترويسات الطلب.
node proxy-probe.mjs list.txt --judge http://YOUR_SERVER/headersماذا يطبع السكربت
يمر تقدم الفحص إلى stderr في سطر واحد يتحدث. ويطبع السكربت في stdout أسرع 15 بروكسي بزمن الاستجابة وعنوان الخروج والتقييم، وفي السطر الأخير عدد العاملة. هكذا يبدو فحص 38 بروكسي SOCKS5 مجانيًا، مع استبدال العناوين بأمثلة:
$ node proxy-probe.mjs socks.txt --kind socks5 --csv report.csv
checking 38 proxies, 150 at a time, via httpbin.org
38/38 checked, 25 alive
198.51.100.17:1088 3497 ms 203.0.113.40 high
192.0.2.63:10461 3667 ms 198.51.100.86 high
203.0.113.109:13391 3844 ms 192.0.2.132 high
198.51.100.155:38182 3954 ms 198.51.100.155 high
203.0.113.178:80 4170 ms 203.0.113.178 high
192.0.2.201:16209 4240 ms 198.51.100.224 high
203.0.113.247:1080 4327 ms 203.0.113.247 high
192.0.2.20:1080 4340 ms 198.51.100.43 high
203.0.113.66:1026 4494 ms 192.0.2.89 high
203.0.113.66:1059 4572 ms 192.0.2.89 high
203.0.113.66:1045 4654 ms 192.0.2.89 high
203.0.113.66:1087 4666 ms 198.51.100.112 high
203.0.113.66:1099 4752 ms 198.51.100.112 high
203.0.113.135:10800 4786 ms 203.0.113.135 high
192.0.2.158:1080 4917 ms 192.0.2.158 high
25 of 38 alive, saved to alive.txtتبقى الأسطر في alive.txt بالشكل الذي جاءت به في القائمة. يضيف إليها تقرير CSV القياسات:
$ head -3 alive.txt
198.51.100.17:1088
192.0.2.63:10461
203.0.113.109:13391
$ head -4 report.csv
proxy,ms,exit_ip,anonymity
198.51.100.17:1088,3497,203.0.113.40,high
192.0.2.63:10461,3667,198.51.100.86,high
203.0.113.109:13391,3844,192.0.2.132,highتثبيت Node.js على خادم نظيف
افحص الإصدار أولًا بالأمر node -v: يصلح v18 وأحدث. إن لم يكن Node موجودًا أو كان قديمًا فثبّته لنظامك. تعمل الأوامر أدناه بصلاحية root، ويحتاج المستخدم العادي إلى sudo قبل apt وdnf وbash.
Debian 12 وUbuntu 24.04: يصلح Node من المستودع القياسي.
apt update && apt install -y nodejs
node -vUbuntu 20.04 و22.04 وDebian 11 والأنظمة التي في مستودعها Node أقدم من 18: أحدث LTS من مستودع NodeSource.
apt update && apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
node -vAlmaLinux وRocky Linux وCentOS Stream:
curl -fsSL https://rpm.nodesource.com/setup_22.x | bash -
dnf install -y nodejs
node -vالتشغيل على Windows
ثبّت Node.js LTS عبر winget، وهو مدمج في Windows 10 و11. بعد التثبيت افتح نافذة طرفية جديدة ليتحدث PATH.
winget install OpenJS.NodeJS.LTSنزّل السكربت وابدأ الفحص في PowerShell:
iwr https://proxymix.net/res/files/proxy-probe.mjs -OutFile proxy-probe.mjs -UseBasicParsing; node proxy-probe.mjs list.txtفي موجه أوامر cmd يعمل curl المدمج:
curl -fsSLo proxy-probe.mjs https://proxymix.net/res/files/proxy-probe.mjs && node proxy-probe.mjs list.txtضع القائمة في المجلد نفسه أو حدد المسار الكامل بين علامتي اقتباس: node proxy-probe.mjs "C:\proxy\list.txt". يظهر الملف alive.txt في المجلد الذي شغّلت منه الأمر.
الفحص وفق جدول
لكي يأخذ برنامجك بروكسيات حية دائمًا، شغّل الأداة بمؤقت واحفظ النتيجة في ملف ثابت واحد. يكتب السكربت القائمة الجديدة في fresh.txt مؤقت، ثم يستبدل بها أمر واحد alive.txt، فلا يصادف البرنامج ملفًا في منتصف الكتابة. إن لم يبقَ أي بروكسي انتهى السكربت بالرمز 1 وبقيت في alive.txt القائمة السابقة.
Linux: ضع السكربت في مجلد منفصل وافتح مجدول cron.
mkdir -p /opt/probe && cd /opt/probe
wget -qO proxy-probe.mjs https://proxymix.net/res/files/proxy-probe.mjs
crontab -eأضف هذا السطر: فحص كل 20 دقيقة، ولا يسمح flock بنسخة ثانية ما دامت الأولى تعمل، ويُكتب السجل في probe.log.
*/20 * * * * cd /opt/probe && flock -n probe.lock node proxy-probe.mjs "https://YOUR_LIST_LINK" --output fresh.txt >> probe.log 2>&1 && mv fresh.txt alive.txtWindows: أنشئ المجلد C:\probe وضع فيه السكربت وملف run.cmd بسطرين:
cd /d C:\probe
node proxy-probe.mjs "https://YOUR_LIST_LINK" --output fresh.txt >> probe.log 2>&1 && move /y fresh.txt alive.txtأمر واحد ينشئ مهمة كل 20 دقيقة:
schtasks /create /tn "proxy-probe" /tr "C:\probe\run.cmd" /sc minute /mo 20تعمل هذه المهمة ما دمت مسجلًا الدخول. لكي تعمل دون تسجيل دخول، نفّذ الأمر كمسؤول مع المفتاح /ru SYSTEM. تُكتب العلامة % في رابط القائمة داخل run.cmd مرتين: %%.
في البرنامج حدد alive.txt كملف بروكسي: /opt/probe/alive.txt على Linux وC:\probe\alive.txt على Windows. إن كان البرنامج يعيد قراءة الملف بمؤقت ففعّل ذلك، فتصل الأسطر الجديدة دون إعادة تشغيل.
كيف يُحسب مستوى الإخفاء
قبل الفحص يتصل السكربت بصفحة judge مباشرة ويتذكر عنوانك أنت. ثم يقارن به كل إجابة:
- high: لم ترَ judge عنوانك ولا ترويسات بروكسي مثل Via أو X-Forwarded-For؛
- medium: عنوانك مخفي، لكن البروكسي كشف نفسه بالترويسات؛
- none: وصل عنوانك الحقيقي إلى judge، والبروكسي يمرر المرور فقط.
قوائم ProxyMix
تبدو أسطر الخطط بالـ GB هكذا host:port:login:password: اسم المستخدم موجود في السطر، وتمرره الأداة إلى البروكسي بنفسها. افحص كل سطر من هذه الخطط بالبروتوكول الذي أُنشئ له.
للأداة استخدم رابط الباقة دون .csv في آخره: لا حاجة إلى اسم مستخدم، ولا تقرأ الأداة الجدول. الوصول مفتوح للـ IP الذي أضفته في لوحة التحكم، لذلك شغّل الأداة من ذلك الخادم. يقبل المنفذ الواحد HTTP وHTTPS وSOCKS4 وSOCKS5: افحص بالبروتوكول الذي يستخدمه برنامجك.
تُحمَّل الأسطر المفحوصة من alive.txt مباشرة في ScrapeBox وKey Collector أو في كود Python.
رموز الخروج والرسائل
- الرمز 0: يعمل بروكسي واحد على الأقل. الرمز 1: لا يعمل أي منها، أو لا توجد في القائمة أسطر بروكسي.
- الرمز 2: معامل خاطئ، ويطبع السكربت المساعدة.
- «judge did not answer directly»: صفحة judge غير متاحة أو محجوبة عن جهازك. اختر غيرها، وإلا مرت البروكسيات الشفافة دون أن تُلاحظ.
- «N of M lines with credentials were rejected»: أجابت هذه البروكسيات لكنها رفضت اسم المستخدم أو كلمة المرور. لا تُعد ميتة. افحص بيانات الوصول في لوحة المزود.
كود السكربت
الكود مفتوح بالكامل، اقرأه قبل تشغيله على خادمك.
عرض كود proxy-probe.mjs
import net from 'node:net';
import { readFile, writeFile } from 'node:fs/promises';
const settings = {
parallel: 150,
kind: 'http',
wait: 8,
judge: 'http://httpbin.org/get',
output: 'alive.txt',
csv: '',
};
const help = `usage: node proxy-probe.mjs <list-url-or-file> [options]
list lines ip:port, host:port:login:password or login:password@host:port;
start a line with socks5:// or http:// to set its protocol,
colons and @ signs inside a password are fine
--parallel N proxies checked at the same time (150)
--kind K http or socks5 (http)
--wait S seconds per proxy (8)
--judge URL plain http page that echoes request headers (http://httpbin.org/get)
--output FILE working proxies, fastest first (alive.txt)
--csv FILE extra report: proxy, ms, exit ip, anonymity`;
const args = process.argv.slice(2);
const source = args.find((a, i) => !a.startsWith('--') && !(args[i - 1] || '').startsWith('--'));
for (let i = 0; i < args.length; i++) {
const name = args[i].startsWith('--') ? args[i].slice(2) : '';
if (name === 'help') {
console.log(help);
process.exit(0);
}
if (name in settings) settings[name] = typeof settings[name] === 'number' ? Number(args[++i]) : args[++i];
}
if (!source || !['http', 'socks5'].includes(settings.kind) || !(settings.parallel > 0) || !(settings.wait > 0)) {
console.error(help);
process.exit(2);
}
const judge = new URL(settings.judge);
const judgePort = Number(judge.port || 80);
const leakHeaders = /\b(via|x-forwarded-for|forwarded|x-real-ip|client-ip|x-proxy-id)\b/i;
const ipv4 = /\b(?:\d{1,3}\.){3}\d{1,3}\b/g;
const scrub = (text) => text.split(judge.hostname).join('');
const protoPrefix = /^(http|socks5h?):\/\/(.+)$/i;
const plausible = (host) => host === 'localhost' || /^[\w-]+(\.[\w-]+)+$/.test(host);
const validPort = (port) => /^\d{1,5}$/.test(port) && Number(port) > 0 && Number(port) < 65536;
const keyed = (item) => item.login !== undefined;
const label = (item) => (keyed(item) ? `${item.login}@${item.host}:${item.port}` : item.text);
const cell = (value) => (/[",\r\n]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value);
const rejected = () => Object.assign(new Error('credentials rejected'), { rejected: true });
function decode(raw) {
const text = raw.trim();
const tagged = text.match(protoPrefix);
const body = tagged ? tagged[2].replace(/\/+$/, '') : text;
const kind = tagged ? (tagged[1].toLowerCase() === 'http' ? 'http' : 'socks5') : '';
const guesses = [];
const colonForm = body.match(/^([^:@]+):(\d+):([^:]*):(.*)$/);
if (colonForm) guesses.push({ host: colonForm[1], port: colonForm[2], login: colonForm[3], password: colonForm[4] });
const atForm = body.match(/^([^:]*)(?::(.*))?@([^:@]+):(\d+)$/);
if (atForm) guesses.push({ host: atForm[3], port: atForm[4], login: atForm[1], password: atForm[2] ?? '' });
const usable = guesses.filter((g) => validPort(g.port));
const best = usable.find((g) => plausible(g.host)) || usable[0];
if (best) return { text, kind, ...best, port: Number(best.port) };
if (tagged) {
const bare = body.match(/^([^:@/]+):(\d+)$/);
return bare && validPort(bare[2]) ? { text, kind, host: bare[1], port: Number(bare[2]) } : null;
}
const [host, port] = text.split(':');
return host && /^\d+$/.test(port || '') ? { text: `${host}:${port}`, kind, host, port: Number(port) } : null;
}
async function loadLines(from) {
const text = /^https?:\/\//.test(from) ? await (await fetch(from)).text() : await readFile(from, 'utf8');
const seen = new Map();
for (const raw of text.split(/\r?\n/)) {
const item = decode(raw);
if (item && !seen.has(item.text)) seen.set(item.text, item);
}
return [...seen.values()];
}
function talk(host, port) {
const sock = net.connect({ host, port: Number(port) });
let buffered = Buffer.alloc(0);
let waiter = null;
let ended = false;
const wake = () => waiter && waiter();
sock.on('data', (chunk) => { buffered = Buffer.concat([buffered, chunk]); wake(); });
sock.on('end', () => { ended = true; wake(); });
sock.on('error', () => { ended = true; wake(); });
sock.on('close', () => { ended = true; wake(); });
const take = (count) => new Promise((resolve, reject) => {
const check = () => {
if (buffered.length >= count) {
const part = buffered.subarray(0, count);
buffered = buffered.subarray(count);
waiter = null;
resolve(part);
} else if (ended) {
waiter = null;
reject(new Error('closed'));
}
};
waiter = check;
check();
});
const rest = () => new Promise((resolve) => {
const check = () => { if (ended) resolve(buffered.toString('latin1')); };
waiter = check;
check();
});
const ready = new Promise((resolve, reject) => {
sock.once('connect', resolve);
sock.once('error', reject);
sock.once('close', () => reject(new Error('closed')));
});
return { sock, take, rest, ready };
}
async function socksOpen(link, item) {
const withLogin = keyed(item);
link.sock.write(Buffer.from([5, 1, withLogin ? 2 : 0]));
const hello = await link.take(2);
if (hello[0] !== 5) throw new Error('socks reply');
if (withLogin && hello[1] === 255) throw rejected();
if (withLogin && hello[1] === 2) {
const user = Buffer.from(item.login);
const secret = Buffer.from(item.password);
if (!user.length || user.length > 255 || secret.length > 255) throw rejected();
link.sock.write(Buffer.concat([Buffer.from([1, user.length]), user, Buffer.from([secret.length]), secret]));
const ack = await link.take(2);
if (ack[1] !== 0) throw rejected();
} else if (hello[1] !== 0) {
throw new Error('socks auth');
}
const name = Buffer.from(judge.hostname);
link.sock.write(Buffer.concat([Buffer.from([5, 1, 0, 3, name.length]), name, Buffer.from([judgePort >> 8, judgePort & 255])]));
const head = await link.take(4);
if (head[1] !== 0) throw new Error('socks refused');
const tail = head[3] === 1 ? 6 : head[3] === 4 ? 18 : (await link.take(1))[0] + 2;
await link.take(tail);
}
async function probe(item) {
const kind = item.kind || settings.kind;
const started = performance.now();
const link = talk(item.host, item.port);
const timer = setTimeout(() => link.sock.destroy(), settings.wait * 1000);
try {
await link.ready;
if (kind === 'socks5') await socksOpen(link, item);
const target = kind === 'socks5' ? judge.pathname + judge.search : judge.href;
const pass = kind === 'http' && keyed(item)
? `Proxy-Authorization: Basic ${Buffer.from(`${item.login}:${item.password}`).toString('base64')}\r\n`
: '';
link.sock.write(`GET ${target} HTTP/1.1\r\nHost: ${judge.host}\r\nUser-Agent: proxy-probe\r\nAccept: */*\r\n${pass}Connection: close\r\n\r\n`);
const answer = await link.rest();
const [head, ...bodyParts] = answer.split('\r\n\r\n');
if (pass && /^HTTP\/1\.[01] 407/.test(head)) return { item, rejected: true };
if (!/^HTTP\/1\.[01] 200/.test(head)) return null;
const body = bodyParts.join('\r\n\r\n');
return { item, ms: Math.round(performance.now() - started), body };
} catch (err) {
return err.rejected ? { item, rejected: true } : null;
} finally {
clearTimeout(timer);
link.sock.destroy();
}
}
function grade(body, myIp) {
const text = scrub(body);
if (myIp && text.includes(myIp)) return 'none';
return leakHeaders.test(text) ? 'medium' : 'high';
}
let myIp = '';
try {
myIp = (scrub(await (await fetch(judge.href, { signal: AbortSignal.timeout(10000) })).text()).match(ipv4) || [''])[0];
} catch {
console.error('judge did not answer directly, anonymity will not detect transparent proxies');
}
const entries = await loadLines(source);
if (!entries.length) {
console.error('no proxy lines found in', source);
process.exit(1);
}
const withCredentials = entries.filter(keyed).length;
console.error(`checking ${entries.length} proxies${withCredentials ? ` (${withCredentials} with credentials)` : ''}, ${settings.parallel} at a time, via ${judge.host}`);
const alive = [];
const turnedAway = [];
let cursor = 0;
let done = 0;
let lastShown = 0;
const lane = async () => {
while (cursor < entries.length) {
const hit = await probe(entries[cursor++]);
done++;
if (hit && hit.rejected) {
turnedAway.push(hit.item);
} else if (hit) {
const found = scrub(hit.body).match(ipv4) || [];
const exit = found.find((ip) => ip !== myIp) || found[0] || '';
alive.push({ entry: hit.item.text, shown: label(hit.item), ms: hit.ms, exit, level: grade(hit.body, myIp) });
}
if (done - lastShown >= Math.max(1, Math.ceil(entries.length / 20)) || done === entries.length) {
lastShown = done;
const denied = turnedAway.length ? `, ${turnedAway.length} rejected credentials` : '';
process.stderr.write(`\r${done}/${entries.length} checked, ${alive.length} alive${denied} `);
}
}
};
await Promise.all(Array.from({ length: Math.min(settings.parallel, entries.length) }, lane));
process.stderr.write('\n');
alive.sort((a, b) => a.ms - b.ms);
await writeFile(settings.output, alive.map((p) => p.entry).join('\n') + (alive.length ? '\n' : ''));
if (settings.csv) {
const rows = ['proxy,ms,exit_ip,anonymity', ...alive.map((p) => `${cell(p.entry)},${p.ms},${p.exit},${p.level}`)];
await writeFile(settings.csv, rows.join('\n') + '\n');
}
const top = alive.slice(0, 15);
const width = Math.max(22, ...top.map((p) => p.shown.length));
for (const p of top) console.log(`${p.shown.padEnd(width)} ${String(p.ms).padStart(5)} ms ${p.exit.padEnd(15)} ${p.level}`);
if (turnedAway.length) {
console.log(`${turnedAway.length} of ${withCredentials} lines with credentials were rejected, first ${label(turnedAway[0])}: check the login and password`);
}
console.log(`${alive.length} of ${entries.length} alive, saved to ${settings.output}`);
process.exit(alive.length ? 0 : 1);ماذا بعد
تحتاج إلى آلاف الأسطر التي لا تموت: أنشئ طلبًا بالنوع والدولة المطلوبين. العناوين المجانية حسب الدولة في صفحة البروكسي المجاني، وتشرح أدلة الإعداد كيف تحمّل الملف المفحوص في البرامج.