Communitygithub.com

baronguyen001/ai-automation-skills (Proxy Rotator)

HTTP/SOCKS 프록시 풀을 라운드 로빈 방식으로 순환시키고, 실패를 추적하며, 죽은 프록시를 재시도 전에 일정 시간 동안 제외(쿨다운)합니다. 프록시 목록은 직접 환경 변수로 제공해야 하며, 이 스킬에는 포함되어 있지 않습니다. 프록시 순환, 요청 분산, IP 차단 회피, 다른 프록시를 통한 재시도, 프록시 상태 확인에 사용하세요.

ai-automation-skills (Proxy Rotator)란 무엇인가요?

이 Proxy Rotator 스킬은 여러 프록시를 통해 요청을 분산하고, 실패한 프록시를 자동으로 제외하며 재사용을 최적화합니다. 사용자는 환경 변수(`PROXY_POOL`)를 통해 HTTP 또는 SOCKS 프록시 목록을 제공하면, 스킬이 라운드 로빈 방식으로 다음 건강한 프록시를 반환하고, 각 요청 후 결과를 피드백받아 실패 횟수를 추적합니다. 지정된 `max_fails`를 초과하면 해당 프록시는 `cooldown` 시간 동안 제외되었다가 이후 다시 시도됩니다. 이 스킬은 Claude Code, Cursor, Codex 등 주요 AI 에이전트 플랫폼에서 사용 가능하며, Python 기반의 경량 모듈(`rotator.py`)로 제공됩니다. 대규모 스크래핑, 테스트 자동화, IP 차단이 우려되는 환경에서 특히 유용하며, `health_check` 기능을 통해 배치 작업 전에 죽은 프록시를 사전에 걸러낼 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/proxy-rotator

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Proxy Rotator (프록시 순환기)

이 스킬은 스크래퍼가 여러 프록시에 요청을 분산하고, 죽은 프록시에 대한 반복적인 요청을 중단해야 할 때 사용합니다. 순환기는 다음 건강한 프록시를 할당하고, 실패 횟수를 추적하며, 특정 프록시가 너무 자주 실패하면 일정 시간(쿨다운) 동안 제외한 후 다시 기회를 부여합니다. 프록시 목록은 직접 제공해야 하며, 어떠한 프록시도 이 스킬에 포함되어 있지 않습니다.

호출 시점

  • 사용자가 "프록시 순환", "프록시에 요청 분산", "IP 차단 방지", "다른 프록시로 재시도" 등을 요청할 때.
  • 대화 중인 코드가 많은 수의 아웃바운드 요청을 수행하며, 이를 프록시 풀에 분산해야 할 때.

호출하지 말아야 할 때

  • 단일 연결로 충분하거나, 대상 서버가 허용하는 트래픽 양을 초과하지 않을 때 - 프록시 순환은 불필요한 복잡성을 추가합니다.
  • 명시적인 차단을 우회하거나 서비스를 남용하려는 의도일 때 - 대상의 이용 약관을 준수해야 합니다.

구체적인 예시

사용자 입력:

프록시 5개가 있습니다. 라운드 로빈 방식으로 순환하고, 실패하기 시작하는 프록시는 건너뛰세요.

출력:

import requests
from rotator import ProxyRotator

rot = ProxyRotator.from_env()        # PROXY_POOL="http://h1:8080,socks5://h2:1080,..."
for url in urls:
    p = rot.get()                    # 다음 건강한 프록시
    try:
        r = requests.get(url, proxies=p.as_dict(), timeout=15)
        rot.report(p, ok=r.ok)       # 결과를 피드백하여 풀이 자동 복구되도록 함
    except Exception:
        rot.report(p, ok=False)      # 실패가 너무 많으면 쿨다운 동안 제외됨

적용 패턴

  1. 환경 변수 또는 .gitignore에 포함된 파일에서 프록시를 로드합니다. 실제 프록시 URL이나 자격 증명을 절대 커밋하지 마세요.
  2. 각 요청 후 항상 report(proxy, ok=...)를 호출하여 실패한 프록시가 자동으로 제외되도록 합니다.
  3. max_fails와 cooldown을 대상에 맞게 조정합니다. 짧은 쿨다운은 불안정한 프록시를 복구하고, 긴 쿨다운은 나쁜 프록시를 제외합니다.
  4. 대규모 배치 전에 health_check를 실행하여 미리 죽은 프록시를 제외합니다.
  5. "건강한 프록시 없음" 오류를 처리합니다. 실행을 중단하지 말고 백오프(back off) 후 재시도하세요.

참고: assets/rotator.py.

출처

저자의 자동화 프로젝트에서 실제 사용 경험을 바탕으로 정리되었습니다. v1.0.0. 참고: [[playwright-login-session]], [[pipeline-orchestrator]], [[cron-dispatch]].

→ Trawlkit으로 완전한 실행 가능 봇을 구축하세요.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

baronguyen001/ai-automation-skills

Schedule any script to run on a recurring schedule on Windows (Task Scheduler) or Linux (cron) - register, list, and remove jobs from one command, with logging to a file and a guard against overlapping runs. Use for schedule a script, run nightly, set up a cron job, windows task scheduler, or run on a timer.

baronguyen001/ai-automation-skills

Turn a run's list of result dicts into a schema'd CSV and a Markdown table from one column spec - declare columns once, emit both, with stable ordering and safe escaping, stdlib only, no pandas. Use when the user asks to write results to CSV, export a report, make a markdown summary table, or save a run's output as a spreadsheet.

baronguyen001/ai-automation-skills

Strip HTML to clean plain text with the standard library only (no BeautifulSoup/lxml): drops script/style, turns block tags into line breaks, and collapses whitespace. Use when the user wants readable text from an HTML page/email, to clean scraped HTML before sending it to an LLM, or to build a text index from web content.

baronguyen001/ai-automation-skills

Persist records between scheduled runs as append-only JSON Lines (one object per line) with streaming reads and optional key-based dedup, stdlib only. Use when the user wants to log run results to JSONL, append events to a file, dedup records by id across runs, or keep a simple durable history without a database.

baronguyen001/ai-automation-skills

Extract text and simple table-like rows from a PDF for downstream AI without OCR binaries. Use when the user asks to read a PDF, turn a PDF into text, pull simple tables from statements/reports, or feed PDF content into an LLM pipeline.

baronguyen001/ai-automation-skills

Parse an RSS 2.0 or Atom feed into normalized item dicts (title, link, id, published, summary) with the standard library only - no feedparser. Use when the user asks to read an RSS/Atom feed, poll a blog/news feed, extract feed entries, or watch a site that publishes a feed.

baronguyen001/ai-automation-skills

Upload and download run artifacts from S3-compatible storage with BYO bucket and credentials from env. Use when the user asks to store scraper output, archive reports, publish artifacts to object storage, fetch a prior run file, or use MinIO/R2/Spaces/S3 without hardcoding credentials.

baronguyen001/ai-automation-skills

Draft a short-form TikTok/Reels/Shorts or long-form video script from a topic and creator persona file - hook variants, beat-structured body, CTA, b-roll cues, caption overlays, and [STORY]/[NUMBER] slots so the model never fabricates personal facts. Use for write a video script, tiktok script, youtube script, or /shortform-script.

baronguyen001/ai-automation-skills

Give scheduled scripts memory between runs with one SQLite file - a seen-set for dedup, a key/value cursor to resume where you left off, and order-preserving new-item filtering. Use for dedup across runs, don't re-alert the same item, remember the last id, resume a scraper, or persist state between cron runs.

관련 스킬