Communitygithub.com

Xray 프록시 서버 (VLESS/VMess/Trojan/Shadowsocks)

Xray-core 기반의 고급 프록시 서버를 배포하고 구성합니다. VLESS, VMess, Trojan, Shadowsocks 프로토콜과 Reality, TLS, WebSocket, gRPC 등 다양한 전송 방식을 지원하며, 멀티 사용자 관리, 트래픽 라우팅, CDN 연동 등을 다룹니다.

VMess/Trojan/Shadowsocks)란 무엇인가요?

이 스킬은 Xray-core 프록시 플랫폼을 배포하고 구성하는 방법을 상세히 설명합니다. VLESS, VMess, Trojan, Shadowsocks와 같은 주요 프록시 프로토콜과 Reality, XTLS-Vision, WebSocket, gRPC, HTTP/2 같은 현대적인 전송 방식을 지원합니다. 서버 배포, 프로토콜 선택, TLS/Reality 구성, 트래픽 라우팅, 다중 사용자 관리, CDN 통합, 클라이언트 구성 및 모니터링을 포함한 포괄적인 내용을 담고 있습니다. 특히 권장 구성인 VLESS + Reality는 도메인이나 인증서 없이도 가장 강력한 보안과 난독화 기능을 제공하며, Cloudflare CDN 연동을 통해 IP를 숨기는 구성도 상세히 다룹니다. 또한 Xray API를 통해 서비스를 재시작하지 않고도 런타임에 사용자를 추가/제거하고 트래픽을 모니터링하는 방법을 안내합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/xray

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

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

문서

Xray

개요

VLESS, VMess, Trojan, Shadowsocks 프로토콜을 Reality, XTLS-Vision, WebSocket, gRPC, HTTP/2 같은 현대적인 전송 방식과 함께 지원하는 고급 프록시 플랫폼인 Xray-core를 배포하고 구성합니다. 이 스킬은 서버 배포, 프로토콜 선택, TLS/Reality 구성, 트래픽 라우팅, 다중 사용자 관리, CDN 통합, 클라이언트 구성 및 모니터링을 다룹니다.

지침

1단계: 설치

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
xray version
# 바이너리: /usr/local/bin/xray
# 설정: /usr/local/etc/xray/config.json

# UUID 및 X25519 키 생성
xray uuid
xray x25519   # Reality용 개인키 + 공개키 쌍

2단계: VLESS + Reality (권장)

가장 안전한 설정입니다. Reality는 실제 HTTPS 웹사이트의 TLS 핸드셰이크를 모방하므로 도메인이나 TLS 인증서가 필요하지 않습니다.

서버 설정 (/usr/local/etc/xray/config.json):

{
  "log": { "loglevel": "warning" },
  "inbounds": [{
    "listen": "0.0.0.0",
    "port": 443,
    "protocol": "vless",
    "settings": {
      "clients": [
        { "id": "YOUR-UUID", "flow": "xtls-rprx-vision", "email": "user1@proxy" }
      ],
      "decryption": "none"
    },
    "streamSettings": {
      "network": "tcp",
      "security": "reality",
      "realitySettings": {
        "dest": "www.microsoft.com:443",
        "serverNames": ["www.microsoft.com", "microsoft.com"],
        "privateKey": "YOUR-PRIVATE-KEY",
        "shortIds": ["", "0123456789abcdef"]
      }
    },
    "sniffing": { "enabled": true, "destOverride": ["http", "tls", "quic"] }
  }],
  "outbounds": [
    { "protocol": "freedom", "tag": "direct" },
    { "protocol": "blackhole", "tag": "block" }
  ],
  "routing": {
    "rules": [{ "type": "field", "ip": ["geoip:private"], "outboundTag": "block" }]
  }
}

클라이언트 공유 링크:

vless://UUID@SERVER_IP:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=www.microsoft.com&fp=chrome&pbk=PUBLIC_KEY&sid=0123456789abcdef&type=tcp#MyProxy
systemctl enable --now xray

3단계: VLESS + WebSocket + TLS (CDN 호환)

서버 IP를 숨기기 위해 Cloudflare CDN을 통해 라우팅합니다. Cloudflare 프록시가 적용된 도메인과 TLS 인증서가 필요합니다.

apt install -y certbot
certbot certonly --standalone -d proxy.yourdomain.com
{
  "inbounds": [
    {
      "port": 443, "protocol": "vless",
      "settings": {
        "clients": [{ "id": "YOUR-UUID" }],
        "decryption": "none",
        "fallbacks": [
          { "dest": 8080 },
          { "path": "/ws-path", "dest": 8443, "xver": 1 }
        ]
      },
      "streamSettings": {
        "network": "tcp", "security": "tls",
        "tlsSettings": {
          "certificates": [{
            "certificateFile": "/etc/letsencrypt/live/proxy.yourdomain.com/fullchain.pem",
            "keyFile": "/etc/letsencrypt/live/proxy.yourdomain.com/privkey.pem"
          }]
        }
      }
    },
    {
      "listen": "127.0.0.1", "port": 8443, "protocol": "vless",
      "settings": { "clients": [{ "id": "YOUR-UUID" }], "decryption": "none" },
      "streamSettings": { "network": "ws", "wsSettings": { "path": "/ws-path" } }
    }
  ],
  "outbounds": [{ "protocol": "freedom", "tag": "direct" }]
}

8080 포트에서 대체 사이트(nginx)를 구성합니다. Cloudflare 설정: SSL/TLS 전체(엄격), WebSocket 활성화.

4단계: Trojan 및 Shadowsocks

Trojan (일반 HTTPS처럼 보임):

{
  "inbounds": [{
    "port": 443, "protocol": "trojan",
    "settings": {
      "clients": [{ "password": "your-strong-password", "email": "user1@trojan" }],
      "fallbacks": [{ "dest": 8080 }]
    },
    "streamSettings": {
      "network": "tcp", "security": "tls",
      "tlsSettings": { "certificates": [{ "certificateFile": "...", "keyFile": "..." }] }
    }
  }]
}

Shadowsocks 2022 (최신 AEAD 암호):

{
  "inbounds": [{
    "port": 8388, "protocol": "shadowsocks",
    "settings": { "method": "2022-blake3-aes-128-gcm", "password": "BASE64_KEY", "network": "tcp,udp" }
  }]
}

키 생성: openssl rand -base64 16 (또는 aes-256의 경우 -base64 32)

5단계: 다중 사용자 관리

"clients": [
  { "id": "uuid-1", "email": "alice@proxy", "flow": "xtls-rprx-vision" },
  { "id": "uuid-2", "email": "bob@proxy", "flow": "xtls-rprx-vision" },
  { "id": "uuid-3", "email": "carol@proxy", "flow": "xtls-rprx-vision" }
]

사용자별 트래픽 통계 — 통계 API 활성화:

{
  "stats": {},
  "policy": {
    "levels": { "0": { "statsUserUplink": true, "statsUserDownlink": true } },
    "system": { "statsInboundUplink": true, "statsInboundDownlink": true }
  },
  "api": { "tag": "api", "services": ["StatsService", "HandlerService"] },
  "inbounds": [
    { "listen": "127.0.0.1", "port": 10085, "protocol": "dokodemo-door",
      "settings": { "address": "127.0.0.1" }, "tag": "api" }
  ],
  "routing": { "rules": [{ "type": "field", "inboundTag": ["api"], "outboundTag": "api" }] }
}

런타임에 사용자 조회 및 관리:

xray api stats --server=127.0.0.1:10085 -name "user>>>alice@proxy>>>traffic>>>uplink"
xray api adi --server=127.0.0.1:10085 --inbound-tag proxy --id "new-uuid" --email "newuser@proxy"
xray api rmi --server=127.0.0.1:10085 --inbound-tag proxy --email "olduser@proxy"

6단계: 라우팅 규칙 및 모니터링

도메인/IP/지역별 라우팅:

{
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      { "type": "field", "domain": ["geosite:category-ads-all"], "outboundTag": "block" },
      { "type": "field", "ip": ["geoip:private"], "outboundTag": "block" },
      { "type": "field", "network": "tcp,udp", "outboundTag": "proxy" }
    ]
  }
}

모니터링:

systemctl status xray
journalctl -u xray -f
grep "accepted" /var/log/xray/access.log | awk '{print $3}' | sort | uniq -c | sort -rn

방화벽:

ufw allow 443/tcp && ufw allow 443/udp && ufw enable

예시

예시 1: 소규모 팀을 위한 VLESS + Reality 프록시 서버 배포

사용자 요청: "Debian 12 VPS(198.51.100.30)에 Reality 전송 방식을 사용한 VLESS로 Xray를 설정해주세요. alice, bob, carol의 계정을 만들어주세요. Reality 대상으로 microsoft.com을 사용하고 v2rayNG용 공유 링크를 제공해주세요."

에이전트는 공식 스크립트로 Xray를 설치하고, 각 사용자의 UUID와 X25519 키 쌍을 생성한 후, config.json에 www.microsoft.com을 대상으로 하는 Reality 설정으로 443 포트의 VLESS 인바운드를 구성하고, xtls-rprx-vision 흐름의 세 클라이언트 항목을 추가하며, 개인 IP 차단 라우팅 규칙을 추가하고, xray 서비스를 활성화 및 시작하고, 방화벽에서 443 포트를 열고, 서버 IP, 공개 키, 짧은 ID, SNI를 포함한 세 개의 vless:// 공유 링크를 출력합니다.

예시 2: Cloudflare 및 대체 사이트를 통한 CDN 프론트 VLESS 프록시 설정

사용자 요청: "proxy.mysite.com이 Cloudflare를 통해 서버를 가리키고 있습니다. /secret-ws 경로에 VLESS over WebSocket을 사용하도록 Xray를 구성하여 트래픽이 Cloudflare CDN을 통과하도록 해주세요. 프록시가 아닌 방문자는 일반 nginx 웹사이트를 보게 해주세요."

에이전트는 certbot으로 Let's Encrypt 인증서를 획득하고, 443 포트에 기본 VLESS+TLS 인바운드를 구성하고 8080 포트의 nginx로 fallback을 설정하며, 로컬호스트 8443 포트에 /secret-ws 경로의 두 번째 VLESS+WebSocket 인바운드를 추가하고, 8080 포트에 정적 사이트를 제공하도록 nginx를 설정하며, Cloudflare SSL이 전체(엄격)로 설정되고 WebSocket이 활성화되었는지 확인하고, WebSocket 경로와 Cloudflare SNI가 포함된 클라이언트 연결 문자열을 제공합니다.

지침

  • 새 배포에는 항상 VLESS + Reality를 사용하십시오. 도메인이나 인증서가 필요 없으며 가장 탐지 및 차단이 어려운 프로토콜입니다.
  • 모든 VMess 사용자에 대해 "alterId": 0을 설정하여 강제 AEAD 암호화를 적용하십시오. 0이 아닌 alterId는 더 이상 사용되지 않는 덜 안전한 레거시 형식입니다.
  • 라우팅 규칙에서 개인 IP 범위(geoip:private)에 대한 액세스를 차단하여 프록시가 내부 서비스에 대한 SSRF 공격에 사용되지 않도록 하십시오.
  • xray api 명령을 사용하여 서비스를 재시작하지 않고 런타임에 사용자를 추가 및 제거하면 활성 사용자 연결이 끊어지지 않습니다.
  • 서버와 다른 IP에서 호스팅되는 인기 웹사이트(microsoft.com, apple.com)에서 Reality dest 및 serverNames을 선택하고 해당 사이트가 TLS 1.3 및 HTTP/2를 지원하는지 확인하십시오.
  • 사용자별 추적(statsUserUplink/statsUserDownlink)이 포함된 통계 API를 활성화하여 대역폭 사용량을 모니터링하고 악용을 감지하십시오.

Individual skills in this repo

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

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- You are an expert in AG2 (formerly AutoGen), the open-source multi-agent conversation framework. You help developers build systems where multiple AI agents collaborate through structured conversations — with tool use, human-in-the-loop, code execution, group chat orchestration, and nested conversations — for complex tasks like software development, research, and data analysis.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

관련 스킬