This commit is contained in:
2026-08-22 11:09:05 -05:00
parent 798422988d
commit 410a33d9ac
1242 changed files with 250078 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
'use strict';
const fs = require('fs');
const path = require('path');
const txtPath = path.join(__dirname, '..', 'proxies.txt');
const jsonPath = path.join(__dirname, '..', 'proxies.json');
if (fs.existsSync(jsonPath)) {
process.stdout.write('migrate: proxies.json already exists. Skipping.\n');
process.exit(0);
}
if (!fs.existsSync(txtPath)) {
process.stdout.write('migrate: no proxies.txt found. Nothing to migrate.\n');
process.exit(0);
}
const { ProxyRegistry } = require('../src/proxy/registry');
const reg = new ProxyRegistry({ persistPath: jsonPath, txtPath, log: (l, m) => process.stdout.write(` [${l}] ${m}\n`) });
const n = reg.loadFromTxt(txtPath);
reg.save();
process.stdout.write(`migrate: imported ${n} proxies → ${jsonPath}\n`);