johnalbertini14-glitch/openclaw-skills / skills/0xclanky/captcha-relay
captcha-relay
FlaggedHuman-in-the-loop CAPTCHA solving with two modes: screenshot (default, zero infrastructure) and token relay (requires network access). Screenshot mode captures the page with a grid overlay, sends it to the human, and injects clicks based on their reply. Token relay mode detects CAPTCHA type + sitekey, serves the real widget on a relay page for native solving, and injects the token via CDP.
| File | Kind | Size |
|---|---|---|
| ARCHITECTURE.md | markdown | 4.2 KB |
| README.md | markdown | 4.0 KB |
| SKILL.md | skill md | 3.6 KB |
| TAILSCALE.md | markdown | 3.0 KB |
| _meta.json | config | 458 B |
| browser-relay-cli.js | script | 981 B |
| fallback/screenshot.js | script | 5.2 KB |
| index.js | script | 5.4 KB |
| lib/browser-relay.js | script | 7.9 KB |
| lib/cdp.js | script | 2.8 KB |
| lib/detect.js | script | 2.8 KB |
| lib/inject.js | script | 4.5 KB |
| lib/server.js | script | 2.6 KB |
| lib/templates/browser-relay.html | other | 7.5 KB |
| lib/templates/hcaptcha.html | other | 1.8 KB |
| lib/templates/recaptcha-v2.html | other | 1.9 KB |
| lib/templates/turnstile.html | other | 1.8 KB |
| lib/tunnel.js | script | 4.2 KB |
| package-lock.json | manifest | 17.2 KB |
| package.json | manifest | 443 B |
lib/tunnel.js
View on GitHub/**
* Tunnel management for public URL access
*
* Strategies (in order):
* 1. localtunnel (via npx) — free, no install, works well
* 2. cloudflared — Cloudflare's tunnel, heavier binary
* 3. Local IP fallback — LAN only
*
* NOTE: For production, Tailscale is recommended. See TAILSCALE.md.
* With Tailscale, no tunnel is needed — the relay server is directly
* accessible via Tailscale IP from any device on the same Tailnet.
*/
const { spawn } = require('child_process');
const os = require('os');
/**
* Start a tunnel to expose localPort publicly.
* @param {number} localPort
* @param {object} opts
* @param {string} opts.method - 'localtunnel' | 'cloudflared' | 'auto' (default: 'auto')
*/
function startTunnel(localPort, opts = {}) {
const method = opts.method || 'auto';
if (method === 'cloudflared') return startCloudflared(localPort);
if (method === 'localtunnel') return startLocaltunnel(localPort);
// Auto: try localtunnel first, fall back to cloudflared, then local IP
return startLocaltunnel(localPort).catch(() =>
startCloudflared(localPort)
);
}
function startLocaltunnel(localPort) {
return new Promise((resolve, reject) => {
const proc = spawn('npx', ['localtunnel', '--port', String(localPort)], {
stdio: ['ignore', 'pipe', 'pipe'],
});
let resolved = false;
const timer = setTimeout(() => {
if (!resolved) {
resolved = true;
proc.kill();
reject(new Error('localtunnel timeout'));
}
}, 30000);
function checkOutput(data) {
const text = data.toString();
const match = text.match(/(https:\/\/[a-z0-9-]+\.loca\.lt)/);
if (match && !resolved) {
resolved = true;
clearTimeout(timer);
resolve({ url: match[1], process: proc, isLocal: false, method: 'localtunnel' });
}
}
proc.stdout.on('data', checkOutput);
proc.stderr.on('data', checkOutput);
proc.on('error', () => {
if (!resolved) {
resolved = true;
clearTimeout(timer);
reject(new Error('localtunnel not available'));
}
});
proc.on('exit', (code) => {
if (!resolved) {
resolved = true;
clearTimeout(timer);
reject(new Error(`localtunnel exited with code ${code}`));
}
});
});
}
function startCloudflared(localPort) {
return new Promise((resolve, reject) => {
const proc = spawn('cloudflared', ['tunnel', '--url', `http://localhost:${localPort}`], {
stdio: ['ignore', 'pipe', 'pipe'],
});
let resolved = false;
const timer = setTimeout(() => {
if (!resolved) {
resolved = true;
proc.kill();
// Final fallback: local IP
const localUrl = `http://${getLocalIp()}:${localPort}`;
resolve({ url: localUrl, process: null, isLocal: true, method: 'local' });
}
}, 15000);
function checkOutput(data) {
const text = data.toString();
const match = text.match(/https:\/\/[a-z0-9-]+\.trycloudflare\.com/);
if (match && !resolved) {
resolved = true;
clearTimeout(timer);
resolve({ url: match[0], process: proc, isLocal: false, method: 'cloudflared' });
}
}
proc.stdout.on('data', checkOutput);
proc.stderr.on('data', checkOutput);
proc.on('error', () => {
if (!resolved) {
resolved = true;
clearTimeout(timer);
const localUrl = `http://${getLocalIp()}:${localPort}`;
resolve({ url: localUrl, process: null, isLocal: true, method: 'local' });
}
});
});
}
function stopTunnel(tunnel) {
if (tunnel && tunnel.process) {
tunnel.process.kill();
}
}
function getTailscaleIp() {
try {
const { execSync } = require('child_process');
const ip = execSync('tailscale ip -4 2>/dev/null', { timeout: 3000 }).toString().trim();
if (/^100\./.test(ip)) return ip;
} catch {}
return null;
}
function getLocalIp() {
const nets = os.networkInterfaces();
for (const name of Object.keys(nets)) {
for (const net of nets[name]) {
if (net.family === 'IPv4' && !net.internal) {
return net.address;
}
}
}
return '127.0.0.1';
}
module.exports = { startTunnel, stopTunnel, getLocalIp, getTailscaleIp };
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |