Communitygithub.com

Xray

Déployez et configurez des serveurs proxy Xray. Utilisez cette compétence lorsqu'un utilisateur demande à mettre en place des proxys VLESS, VMess, Trojan ou Shadowsocks, à configurer le transport Reality ou TLS, à déployer Xray avec XTLS, à configurer le routage de repli, à gérer l'accès multi-utilisateur, à configurer les règles de routage du trafic, à mettre en place un tunnel basé sur CDN, à générer des liens d'abonnement pour les applications clientes, à surveiller le trafic Xray ou à contourner les restrictions réseau. Couvre tous les principaux protocoles Xray, transports et schémas de déploiement.

Qu'est-ce que Xray ?

Cette compétence permet de déployer et configurer Xray-core, une plateforme proxy avancée prenant en charge les protocoles VLESS, VMess, Trojan et Shadowsocks avec des transports modernes tels que Reality, XTLS-Vision, WebSocket, gRPC et HTTP/2. Elle est particulièrement utile pour les développeurs et administrateurs système souhaitant mettre en place des serveurs proxy sécurisés et contourner les restrictions réseau. La compétence couvre l'installation, la configuration des protocoles, la gestion multi-utilisateur, l'intégration CDN (Cloudflare), la configuration des clients et la surveillance du trafic. Elle fournit des instructions détaillées pour les configurations les plus sécurisées comme VLESS + Reality, qui imite une poignée de main TLS d'un site web légitime, éliminant le besoin d'un nom de domaine ou d'un certificat TLS. Les exemples incluent le déploiement pour une petite équipe et la mise en place d'un proxy derrière un CDN avec un site de repli. Les directives recommandent l'utilisation de VLESS + Reality pour les nouveaux déploiements, le blocage des plages IP privées, et l'utilisation des commandes `xray api` pour la gestion dynamique des utilisateurs sans redémarrage du service.

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

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Que fait Xray ?

Aperçu

Déployez et configurez Xray-core — la plateforme proxy avancée prenant en charge les protocoles VLESS, VMess, Trojan et Shadowsocks avec des transports modernes comme Reality, XTLS-Vision, WebSocket, gRPC et HTTP/2. Cette compétence couvre le déploiement du serveur, la sélection de protocole, la configuration TLS/Reality, le routage du trafic, la gestion multi-utilisateur, l'intégration CDN, la configuration client et la surveillance.

Instructions

Étape 1 : Installation

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

# Générer UUID et clés X25519
xray uuid
xray x25519   # Paire de clés privée + publique pour Reality

Étape 2 : VLESS + Reality (Recommandé)

La configuration la plus sécurisée. Reality imite la poignée de main TLS d'un site web HTTPS réel, éliminant le besoin d'un nom de domaine ou d'un certificat TLS.

Configuration serveur (/usr/local/etc/xray/config.json):

{
  "log": { "loglevel": "warning" },
  "inbounds": [{
    "listen": "0.0.0.0",
    "port": 443,
    "protocol": "vless",
    "settings": {
      "clients": [
        { "id": "VOTRE-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": "VOTRE-CLÉ-PRIVÉE",
        "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" }]
  }
}

Lien de partage client :

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

Étape 3 : VLESS + WebSocket + TLS (Compatible CDN)

Pour le routage via le CDN Cloudflare afin de masquer l'adresse IP du serveur. Nécessite un nom de domaine avec proxy Cloudflare et un certificat TLS.

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

Configurez nginx sur le port 8080 comme site de repli, et dans Cloudflare : SSL/TLS Complet (Strict), WebSockets activé.

Étape 4 : Trojan et Shadowsocks

Trojan (ressemble à du HTTPS normal) :

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

Shadowsocks 2022 (chiffrements AEAD modernes) :

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

Générez la clé : openssl rand -base64 16 (ou -base64 32 pour aes-256)

Étape 5 : Gestion multi-utilisateur

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

Statistiques de trafic par utilisateur — activez l'API de statistiques :

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

Interroger et gérer les utilisateurs en cours d'exécution :

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 "nouvel-uuid" --email "nouvelutilisateur@proxy"
xray api rmi --server=127.0.0.1:10085 --inbound-tag proxy --email "ancienutilisateur@proxy"

Étape 6 : Règles de routage et surveillance

Router par domaine/IP/géo :

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

Surveillance :

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

Pare-feu :

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

Exemples

Exemple 1 : Déployer un serveur proxy VLESS + Reality pour une petite équipe

Demande utilisateur : "Configure Xray sur notre VPS Debian 12 à 198.51.100.30 en utilisant VLESS avec le transport Reality. Crée des comptes pour alice, bob et carol. Utilise microsoft.com comme cible Reality et donne-moi les liens de partage pour v2rayNG."

L'agent installera Xray via le script officiel, générera un UUID pour chaque utilisateur et une paire de clés X25519, construira un fichier config.json avec une entrée VLESS sur le port 443 utilisant les paramètres Reality ciblant www.microsoft.com, ajoutera trois entrées client avec le flux xtls-rprx-vision, ajoutera des règles de routage pour bloquer les IP privées, activera et démarrera le service xray, ouvrira le port 443 dans le pare-feu, et produira trois liens de partage vless:// avec l'adresse IP du serveur, la clé publique, l'identifiant court et le SNI.

Exemple 2 : Mettre en place un proxy VLESS fronté par CDN avec Cloudflare et un site de repli

Demande utilisateur : "J'ai proxy.monsite.com pointant vers notre serveur via Cloudflare. Configure Xray avec VLESS sur WebSocket sur /chemin-secret-ws pour que le trafic passe par le CDN de Cloudflare. Les visiteurs non-proxy doivent voir un site nginx normal."

L'agent obtiendra un certificat Let's Encrypt avec certbot, configurera Xray avec une entrée principale VLESS+TLS sur le port 443 avec un repli vers nginx sur le port 8080, ajoutera une deuxième entrée VLESS+WebSocket sur localhost:8443 avec le chemin /chemin-secret-ws, configurera nginx pour servir un site statique sur le port 8080, vérifiera que le SSL Cloudflare est réglé sur Complet (Strict) avec WebSockets activé, et fournira la chaîne de connexion client avec le chemin WebSocket et le SNI Cloudflare.

Directives

  • Utilisez toujours VLESS + Reality pour les nouveaux déploiements ; cela ne nécessite ni nom de domaine ni certificat et est le protocole le plus difficile à détecter et à bloquer
  • Définissez "alterId": 0 pour tous les utilisateurs VMess afin d'activer le chiffrement AEAD obligatoire ; un alterId non nul utilise le format hérité, déprécié et moins sécurisé
  • Bloquez l'accès aux plages d'adresses IP privées (geoip:private) dans les règles de routage pour empêcher le proxy d'être utilisé pour des attaques SSRF contre les services internes
  • Utilisez les commandes xray api pour ajouter et supprimer des utilisateurs en cours d'exécution sans redémarrer le service, ce qui évite de déconnecter les utilisateurs actifs
  • Choisissez la cible Reality dest et les serverNames parmi un site web populaire (microsoft.com, apple.com) hébergé sur une adresse IP différente de celle de votre serveur, et assurez-vous que ce site prend en charge TLS 1.3 et HTTP/2
  • Activez l'API de statistiques avec le suivi par utilisateur (statsUserUplink/statsUserDownlink) pour surveiller l'utilisation de la bande passante et détecter les abus

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 associés