Communitygithub.com

Xray

Xray-core のデプロイと設定を行います。VLESS、VMess、Trojan、Shadowsocks プロキシのセットアップ、Reality や TLS トランスポートの構成、CDN トンネリング、マルチユーザー管理、トラフィックルーティング、購読リンクの生成、トラフィック監視をサポートします。

Xray とは?

このスキルは、高度なプロキシプラットフォーム Xray-core のデプロイと設定を自動化します。VLESS、VMess、Trojan、Shadowsocks の各プロトコルに対応し、Reality、XTLS-Vision、WebSocket、gRPC、HTTP/2 といった最新のトランスポートをサポートします。ドメインや証明書が不要な VLESS + Reality 構成が推奨されており、検出・ブロックが最も困難な方式です。また、Cloudflare CDN を利用した VLESS + WebSocket + TLS 構成、フォールバックルーティング、マルチユーザー管理、トラフィック統計 API の有効化、ファイアウォール設定、`xray api` コマンドによる稼働中のユーザー追加・削除をサポートします。このスキルは、公式インストールスクリプト、certbot、nginx、ufw と連携し、小規模チーム向けのプロキシサーバーのワンコマンドデプロイから、CDN 経由での IP 隠蔽まで、あらゆる Xray 導入パターンをカバーします。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/xray

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Xray は何をしますか?

概要

Xray-core(VLESS、VMess、Trojan、Shadowsocks プロトコルをサポートする高度なプロキシプラットフォーム)のデプロイと設定を行います。Reality、XTLS-Vision、WebSocket、gRPC、HTTP/2 といった最新のトランスポートに対応し、サーバーのデプロイ、プロトコル選択、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 対応)

Cloudflare CDN 経由でルーティングし、サーバー IP を隠蔽するための構成です。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 を Full (Strict) に、WebSocket を ON に設定します。

手順 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/geo によるルーティング:

{
  "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(IP: 198.51.100.30)に Xray をセットアップしてください。VLESS + Reality トランスポートを使用し、alice、bob、carol のアカウントを作成してください。Reality のターゲットは microsoft.com にし、v2rayNG 用の共有リンクを出力してください。」

エージェントは公式スクリプトで Xray をインストールし、各ユーザーの UUID と X25519 鍵ペアを生成し、config.json にポート 443 の VLESS 受信設定(Reality、ターゲット www.microsoft.com)を記述します。3 つのクライアントエントリ(xtls-rprx-vision フロー)を追加し、プライベート IP をブロックするルーティングルールを設定し、xray サービスを有効化・起動し、ファイアウォールでポート 443 を開放し、サーバー IP、公開鍵、ショート ID、SNI を含む vless:// リンクを 3 つ出力します。

例 2: Cloudflare とフォールバックウェブサイトを使用した CDN 対応 VLESS プロキシのセットアップ

ユーザープロンプト: 「proxy.mysite.com が Cloudflare 経由でサーバーを指しています。/secret-ws で VLESS + WebSocket を使用するように Xray を設定し、トラフィックが Cloudflare CDN を経由するようにしてください。プロキシ以外の訪問者には通常の nginx ウェブサイトを表示してください。」

エージェントは certbot で Let's Encrypt 証明書を取得し、Xray にメインの VLESS+TLS 受信設定(ポート 443、nginx 8080 へのフォールバックあり)と、2 つ目の VLESS+WebSocket 受信設定(localhost:8443、パス /secret-ws)を構成します。nginx をポート 8080 で静的サイトを配信するように設定し、Cloudflare の SSL 設定が Full (Strict)、WebSocket が有効であることを確認し、WebSocket パスと Cloudflare SNI を含むクライアント接続文字列を提供します。

ガイドライン

  • 新しいデプロイでは常に VLESS + Reality を使用してください。ドメインや証明書が不要で、検出・ブロックが最も困難なプロトコルです
  • すべての VMess ユーザーで "alterId": 0 を設定し、必須の AEAD 暗号化を有効にしてください。0 以外の alterId は非推奨で安全性の低いレガシーフォーマットを使用します
  • ルーティングルールでプライベート IP 範囲(geoip:private)へのアクセスをブロックし、プロキシが内部サービスへの SSRF 攻撃に使用されるのを防いでください
  • xray api コマンドを使用して、サービスを再起動せずに稼働中にユーザーを追加・削除できます。これによりアクティブユーザーの切断を回避できます
  • Reality の dest と serverNames は、サーバーとは異なる IP にある人気ウェブサイト(microsoft.com、apple.com)から選択し、そのサイトが TLS 1.3 と HTTP/2 をサポートしていることを確認してください
  • 統計 API をユーザーごとの追跡(statsUserUplink/statsUserDownlink)とともに有効にし、帯域幅使用量を監視して不正利用を検出してください

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.

関連スキル