Communitygithub.com

Habilidad Xray

Despliega y configura servidores proxy Xray. Utilízala cuando un usuario solicite configurar proxies VLESS, VMess, Trojan o Shadowsocks, configurar transporte Reality o TLS, desplegar Xray con XTLS, configurar enrutamiento de fallback, gestionar acceso multi-usuario, configurar reglas de enrutamiento de tráfico, establecer túneles basados en CDN, construir enlaces de suscripción para aplicaciones cliente, monitorear tráfico Xray o eludir restricciones de red. Cubre todos los principales protocolos, transportes y patrones de despliegue de Xray.

¿Qué es Habilidad Xray?

Esta habilidad te permite desplegar y configurar Xray-core, una plataforma proxy avanzada que soporta los protocolos VLESS, VMess, Trojan y Shadowsocks, junto con transportes modernos como Reality, XTLS-Vision, WebSocket, gRPC y HTTP/2. Es especialmente útil para desarrolladores y usuarios avanzados que necesitan configurar servidores proxy seguros y eficientes, ya sea para eludir restricciones de red, mejorar la privacidad o gestionar acceso remoto. La habilidad cubre todos los pasos clave: desde la instalación y configuración inicial hasta la gestión de múltiples usuarios con tráfico estadístico, enrutamiento por dominio/IP/geo, y la integración con CDNs como Cloudflare. Funciona en sistemas basados en Linux (por ejemplo, Debian 12) y proporciona ejemplos prácticos de despliegue. Además, incluye guías detalladas para generar enlaces de suscripción para aplicaciones cliente como v2rayNG, y comandos para monitorear y gestionar usuarios sin reiniciar el servicio, garantizando así una operación continua y eficiente.

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

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Xray

Resumen

Despliega y configura Xray-core, la plataforma proxy avanzada que soporta los protocolos VLESS, VMess, Trojan y Shadowsocks con transportes modernos como Reality, XTLS-Vision, WebSocket, gRPC y HTTP/2. Esta habilidad cubre el despliegue del servidor, la selección de protocolo, la configuración de TLS/Reality, el enrutamiento de tráfico, la gestión multi-usuario, la integración con CDN, la configuración del cliente y la monitorización.

Instrucciones

Paso 1: Instalación

bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
xray version
# Binario: /usr/local/bin/xray
# Configuración: /usr/local/etc/xray/config.json

# Generar UUID y claves X25519
xray uuid
xray x25519   # Par de claves Privada + Pública para Reality

Paso 2: VLESS + Reality (Recomendado)

La configuración más segura. Reality imita el handshake TLS de un sitio web HTTPS real, eliminando la necesidad de un dominio o certificado TLS.

Configuración del servidor (/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" }]
  }
}

Enlace de compartición para el cliente:

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

Paso 3: VLESS + WebSocket + TLS (Compatible con CDN)

Para enrutar a través del CDN de Cloudflare y ocultar la IP del servidor. Requiere un dominio con proxy de Cloudflare y un certificado 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" }]
}

Configura nginx en el puerto 8080 como fallback, y en Cloudflare: SSL/TLS Completo (Estricto), WebSockets ACTIVADO.

Paso 4: Trojan y Shadowsocks

Trojan (parece HTTPS normal):

{
  "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 (cifrados AEAD modernos):

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

Generar clave: openssl rand -base64 16 (o -base64 32 para aes-256)

Paso 5: Gestión Multi-Usuario

"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" }
]

Estadísticas de tráfico por usuario — habilita la API de estadísticas:

{
  "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" }] }
}

Consultar y gestionar usuarios en tiempo de ejecución:

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"

Paso 6: Reglas de Enrutamiento y Monitorización

Enrutar por dominio/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" }
    ]
  }
}

Monitorización:

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

Firewall:

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

Ejemplos

Ejemplo 1: Desplegar un servidor proxy VLESS + Reality para un equipo pequeño

Indicación del usuario: "Configura Xray en nuestro VPS Debian 12 en 198.51.100.30 usando VLESS con transporte Reality. Crea cuentas para alice, bob y carol. Usa microsoft.com como destino de Reality y dame los enlaces de compartición para v2rayNG."

El agente instalará Xray mediante el script oficial, generará un UUID para cada usuario y un par de claves X25519, construirá un config.json con un inbound VLESS en el puerto 443 usando configuración Reality apuntando a www.microsoft.com, añadirá tres entradas de cliente con flujo xtls-rprx-vision, agregará reglas de enrutamiento para bloquear IPs privadas, habilitará e iniciará el servicio xray, abrirá el puerto 443 en el firewall, y generará tres enlaces de compartición vless:// con la IP del servidor, clave pública, ID corto y SNI.

Ejemplo 2: Configurar un proxy VLESS con frontend CDN usando Cloudflare y un sitio web de fallback

Indicación del usuario: "Tengo proxy.mysite.com apuntando a nuestro servidor a través de Cloudflare. Configura Xray con VLESS sobre WebSocket en /secret-ws para que el tráfico pase por el CDN de Cloudflare. Los visitantes no proxy deben ver un sitio web nginx normal."

El agente obtendrá un certificado Let's Encrypt con certbot, configurará Xray con un inbound principal VLESS+TLS en el puerto 443 con un fallback a nginx en el puerto 8080, añadirá un segundo inbound VLESS+WebSocket en localhost:8443 con la ruta /secret-ws, configurará nginx para servir un sitio estático en el puerto 8080, verificará que el SSL de Cloudflare esté configurado en Completo (Estricto) con WebSockets habilitado, y proporcionará la cadena de conexión del cliente con la ruta WebSocket y el SNI de Cloudflare.

Directrices

  • Utiliza siempre VLESS + Reality para nuevos despliegues; no requiere dominio ni certificado y es el protocolo más difícil de detectar y bloquear
  • Establece "alterId": 0 para todos los usuarios de VMess para habilitar el cifrado AEAD obligatorio; un alterId distinto de cero utiliza el formato heredado, menos seguro y obsoleto
  • Bloquea el acceso a los rangos de IP privadas (geoip:private) en las reglas de enrutamiento para evitar que el proxy se utilice para ataques SSRF contra servicios internos
  • Usa los comandos xray api para añadir y eliminar usuarios en tiempo de ejecución sin reiniciar el servicio, evitando así desconectar a los usuarios activos
  • Elige el dest y serverNames de Reality de un sitio web popular (microsoft.com, apple.com) alojado en una IP diferente a la de tu servidor, y asegúrate de que ese sitio soporte TLS 1.3 y HTTP/2
  • Habilita la API de estadísticas con seguimiento por usuario (statsUserUplink/statsUserDownlink) para monitorear el uso de ancho de banda y detectar abusos

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.

Skills relacionados