Transporte XHTTP para Xray: guía completa de configuración y diferencias con HTTP

Resumen

Análisis detallado del transporte XHTTP en Xray: cómo funciona, en qué se diferencia de HTTP/WS/gRPC, cuándo usarlo, cómo configurarlo correctamente en servidor y cliente, mejorar la resistencia al DPI y reducir latencias. Instrucciones paso a paso, listas de chequeo, casos prácticos y FAQ para profesionales.

Transporte XHTTP para Xray: guía completa de configuración y diferencias con HTTP

Introducción

El transporte XHTTP para Xray se ha convertido rápidamente entre 2024 y 2026 en una de las formas más prácticas de disfrazar el tráfico como HTTP común y superar de forma fiable los DPI modernos. La razón es sencilla: muchas redes siguen permitiendo HTTP(S) clásico para tráfico legítimo, y XHTTP imita su diálogo sin el pesado framing de HTTP/2 o WebSocket. En esta guía explicaremos qué es XHTTP en el contexto de Xray, cómo funciona internamente, en qué se diferencia del transporte HTTP estándar, proporcionaremos esquemas resistentes a DPI, listas de chequeo, consejos de rendimiento y monitoreo, además de los errores comunes que rompen la conexión en redes reales. Al final, obtendrás una metodología sistemática para diseñar, desplegar y mantener XHTTP según tus escenarios: desde acceso doméstico hasta perímetros corporativos y redes móviles.

Fundamentos

Qué es Xray y transporte

Xray-core es un motor proxy de alto rendimiento que ofrece un modelo flexible de protocolo + transporte + cifrado. Los protocolos a nivel de aplicación (VLESS, VMess, Trojan, etc.) definen autenticación y multiplexación de sesiones, mientras que el transporte (TCP, WebSocket, HTTP/2, gRPC, QUIC, XHTTP) especifica cómo viajan los bytes por la red y qué señales de red detecta el DPI y nodos intermedios. El cifrado (TLS/XTLS/REALITY) e imitación de cliente (uTLS, huellas JA3) esconden el contenido y disfrazan el perfil TLS imitando el comportamiento de navegadores reales.

Dónde encaja XHTTP en esta matriz

XHTTP es un modo de transporte que simula el comportamiento clásico del diálogo HTTP/1.1, pudiendo usar tanto TLS como TCP puro (sin necesidad de análogos h2c). Su objetivo es ofrecer un perfil lo más “común” posible para DPI: encabezados, métodos, rutas, keep-alive, transferencia por fragmentos, patrones Upgrade, y tras un saludo legítimo transformar el flujo en un canal bidireccional de bytes para el tráfico proxy real. Desde fuera parece una petición/respuesta HTTP prolongada con conexión viva, y por dentro funciona como un conducto para tu VLESS/VMess.

Por qué funciona contra DPI

  • Semántica HTTP/1.1. La mayoría de DPI “entienden” y permiten los encabezados, métodos (GET/POST/OPTIONS), codificaciones (chunked) y conexiones keep-alive típicas de HTTP.
  • Framing mínimo. A diferencia de HTTP/2 y WebSocket, XHTTP no utiliza frames/opcodes explícitos y mantiene el flujo como si fuera cuerpo de POST o actualización de conexión. Para muchos inspectores, este es un patrón “normal”.
  • Imitación flexible. Se pueden simular encabezados (User-Agent, Accept, Referer), rutas, hosts, códigos de respuesta e incluso intervalos de transferencia para imitar backend reales.

Comparación: transporte HTTP común en Xray

Xray incluye un transporte HTTP (a menudo HTTP/2 o modos similares a h2c), enfocado en framing y multiplexación interna de flujos en HTTP/2. Esto es conveniente pero deja huellas claras (fingerprints) como ALPN h2, perfiles HPACK específicos y prólogos, además de requerir un acuerdo más complejo. XHTTP evita señales evidentes de HTTP/2, siendo a menudo preferible en redes “restringidas” que sólo permiten HTTP/1.1 simple sobre TLS 1.3, y donde los segmentos HTTP/2/H3 son sospechosos o bloqueados.

Profundización

Arquitectura del flujo XHTTP

  1. TCP/TLS handshake. El cliente establece conexión TCP (o TLS). Si es TLS, activa uTLS para imitar un navegador real (JA3, SNI, ALPN — normalmente http/1.1 más opcionalmente h2 para más realismo).
  2. Petición HTTP. Envía una petición HTTP/1.1 creíble: método (suele ser POST o GET), ruta (ej. /api, /health, /v1/upload), encabezados (Host, User-Agent, Accept, Accept-Language, Content-Type, Connection: keep-alive, TE: trailers, Cache-Control, X-Requested-With, etc.). Hay dos patrones: “POST con cuerpo largo” o intercambio tipo “Upgrade”.
  3. Respuesta del servidor. Responde con 200/204/101 (según patrón), encabezados correctos (Server: nginx, Date, Content-Type, Transfer-Encoding: chunked, Connection: keep-alive), y mantiene la conexión abierta.
  4. Túnel. A partir de aquí ambas partes intercambian bytes útiles del protocolo Xray dentro del cuerpo/segmentos chunked. Para DPI, parece una conexión HTTP viva con cuerpo/fragmentos continuos.

Diferencias clave de XHTTP respecto a HTTP/2 y WebSocket

  • Sin framing explícito a nivel navegador. H2/H3 se detectan por ALPN h2/h3, prioridades y HPACK/QPACK. WS revela Upgrade: websocket, Sec-WebSocket-Key/Accept. XHTTP usa encabezados “normales”.
  • Menos firmas. DPI está entrenado para detectar WebSocket y perfiles HPACK atípicos. XHTTP encaja en el stack clásico HTTP/1.1 conocido.
  • Objetivo falso flexible. Puede parecer un descargador, subidor, SSE largo o endpoint API con respuestas lentas.
  • Fiabilidad en redes “ruidosas”. El manejo sencillo de HTTP/1.1 y chunked suele funcionar bien tras proxies corporativos y NAT.

Rendimiento y costes asociados

  • Overhead de encabezados: pequeño y predecible. En sesiones largas, el impacto es casi nulo.
  • RTT: añade una RTT extra por petición/respuesta HTTP sobre TLS. Se mitiga con keep-alive y datos tempranos (si está soportado).
  • Ancho de banda: comparable a TCP+TLS plano; el cuello de botella suele ser el proxy/load balancer y buffering.

Compatibilidad y ALPN

En la práctica, ALPN “http/1.1” da el perfil más neutro. Si la red prefiere h2, se puede añadir “h2” a la lista, pero el servidor debe responder correctamente, o generará fallos innecesarios. Para un realismo superior, activa la imitación uTLS de Chrome o Firefox actual.

Sección práctica 1: esquema mínimo VLESS+XHTTP sobre TLS

Objetivo

Levantar Xray con protocolo VLESS y transporte XHTTP en el puerto 443/tcp con un certificado válido. Desde fuera, un sitio web común en el mismo dominio o un placeholder estático; el tráfico proxy pasa por la ruta XHTTP.

Pasos

  1. Dominio y DNS. Configura A/AAAA al VPS. Asegúrate que tu IP no esté en listas negras evidentes.
  2. Certificado. Instala certbot o Caddy para TLS automático. Minimiza ALPN extras si no utilizas h2.
  3. Xray. Actualiza a la versión vigente para 2026. Confirma que el build soporte transporte XHTTP.
  4. Configuración servidor. Crea inbound VLESS con streamSettings: network: xhttp, security: tls. Define encabezados creíbles y ruta.
  5. Configuración cliente. Define network: xhttp, serverName y ruta/host igual que en servidor. Activa uTLS.
  6. Firewall. Permite 443/tcp, bloquea puertos innecesarios. Activa optimizaciones conntrack.
  7. Verificación. Usa curl -v https://tu_dominio/ruta — deberías recibir 200/204 honesto. Luego prueba conexión con cliente Xray y revisa métricas en logs.

Ejemplo abreviado de parámetros

Servidor: protocol: vless; clients: UUID; decryption: none; streamSettings: network: xhttp; security: tls; tlsSettings: serverName: tu_dominio; alpn: ["http/1.1"]; xhttpSettings: host: ["tu_dominio"], path: "/api", method: "POST", headers: {"User-Agent": ["Mozilla/5.0"], "Accept": ["* .related-articles { padding-top: 1rem; } .related-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid rgba(59,130,246,0.1); } .related-card { display: flex; flex-direction: column; gap: 0.5rem; height: 100%; background: white; border: 2px solid #e5e7eb; border-radius: 1rem; padding: 1.25rem 1.5rem; text-decoration: none; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 2px 8px rgba(0,0,0,0.04); } .related-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(59,130,246,0.15); border-color: var(--primary); } .related-card-title { font-size: 1.0625rem; font-weight: 600; color: var(--gray-900); line-height: 1.4; } .related-card-meta { font-size: 0.8125rem; color: #6b7280; display: flex; align-items: center; gap: 0.375rem; } .article-tldr { position: relative; margin: 0 0 2rem; padding: 1.25rem 1.5rem 1.25rem 1.75rem; background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(139,92,246,0.05)); border-start: 4px solid var(--primary); border-radius: 0.75rem; } .article-tldr-label { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); margin-bottom: 0.4rem; } .article-tldr p { margin: 0; font-size: 1.0625rem; line-height: 1.6; color: #374151; font-weight: 500; } [data-bs-theme="dark"] .article-tldr { background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(139,92,246,0.10)); } [data-bs-theme="dark"] .article-tldr p { color: #e5e7eb; } [data-bs-theme="dark"] .article-tldr-label { color: #60a5fa; } .author-bio-extended { margin: 2rem 0; } .author-bio-card { background: linear-gradient(135deg, rgba(59,130,246,0.03), rgba(139,92,246,0.03)); border: 1px solid rgba(59,130,246,0.15); border-radius: 1.5rem; padding: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.04); transition: all 0.3s; } .author-bio-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.12); transform: translateY(-2px); } .author-bio-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid rgba(59,130,246,0.15); } .author-bio-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(59,130,246,0.3); } .author-bio-icon i { color: white; font-size: 1.25rem; } .author-bio-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin: 0; } .author-bio-content { display: grid; grid-template-columns: 150px 1fr; gap: 2rem; align-items: start; } .author-photo-wrapper { position: relative; width: 150px; height: 150px; } .author-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 1rem; border: 3px solid white; box-shadow: 0 8px 20px rgba(0,0,0,0.1); } .author-photo-badge { position: absolute; bottom: -8px; right: -8px; width: 36px; height: 36px; background: linear-gradient(135deg, var(--success), #059669); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid white; } .author-photo-badge i { color: white; font-size: 0.75rem; } .author-main-info { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(0,0,0,0.08); } .author-name { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); margin: 0 0 0.25rem; } .author-job { font-size: 0.9rem; color: var(--primary); margin: 0; font-weight: 500; } .author-info-list { display: flex; flex-direction: column; gap: 1rem; } .author-info-item { display: flex; gap: 1rem; align-items: flex-start; } .info-icon { width: 36px; height: 36px; min-width: 36px; background: rgba(59,130,246,0.08); border-radius: 8px; display: flex; align-items: center; justify-content: center; } .info-icon i { color: var(--primary); font-size: 0.875rem; } .info-content { font-size: 0.9rem; line-height: 1.5; } .info-content strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; margin-bottom: 0.25rem; } .expertise-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; } .expertise-tag { padding: 0.25rem 0.75rem; background: rgba(59,130,246,0.08); color: var(--primary); border-radius: 1rem; font-size: 0.8rem; font-weight: 500; border: 1px solid rgba(59,130,246,0.15); } .achievements-list { margin: 0.25rem 0 0; padding-left: 1.25rem; } .achievements-list li { font-size: 0.9rem; margin-bottom: 0.25rem; } .author-bio-text { margin-top: 1rem; padding: 1rem; background: rgba(0,0,0,0.02); border-radius: 0.75rem; border-start: 3px solid var(--primary); } .author-bio-text p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: #4b5563; } @media (max-width: 991px) { .article-content-card { padding: 2rem; } .article-title { font-size: 2rem !important; } .articleBody { font-size: 1rem; } .articleBody h2 { font-size: 1.75rem; } .articleBody h3 { font-size: 1.375rem; } } @media (max-width: 768px) { .article-content-card { padding: 1.5rem; border-radius: 1rem; } .article-title { font-size: 1.75rem !important; } .article-nav-title { font-size: 1rem; } .author-bio-content { grid-template-columns: 1fr; } .author-photo-wrapper { width: 100px; height: 100px; margin: 0 auto; } .info-icon { align-self: flex-start; } } [data-bs-theme="dark"] .article-search { background: #1f2937; border-color: rgba(255,255,255,0.1); color: #f9fafb; } [data-bs-theme="dark"] .article-search::placeholder { color: #9ca3af; } [data-bs-theme="dark"] .article-search:focus { border-color: var(--primary) !important; background: #1f2937; } [data-bs-theme="dark"] .article-content-card { background: #1f2937; border: 1px solid rgba(255,255,255,0.06); } [data-bs-theme="dark"] .article-title { color: #f9fafb !important; } [data-bs-theme="dark"] .article-meta { color: #9ca3af !important; } [data-bs-theme="dark"] .articleBody { color: #d1d5db; } [data-bs-theme="dark"] .articleBody h2, [data-bs-theme="dark"] .articleBody h3, [data-bs-theme="dark"] .articleBody h4 { color: #f9fafb; } [data-bs-theme="dark"] .articleBody a { color: #60a5fa; border-bottom-color: rgba(96,165,250,0.3); } [data-bs-theme="dark"] .articleBody a:hover { color: #93c5fd; border-bottom-color: #60a5fa; } [data-bs-theme="dark"] .articleBody blockquote { background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1)); color: #d1d5db; } [data-bs-theme="dark"] .articleBody code { background: rgba(255,255,255,0.05); color: #f472b6; } [data-bs-theme="dark"] .articleBody pre { background: #111827; } [data-bs-theme="dark"] .article-nav-link { background: #1f2937; border-color: rgba(255,255,255,0.1); } [data-bs-theme="dark"] .article-nav-link:hover { border-color: rgba(59,130,246,0.5); } [data-bs-theme="dark"] .article-nav-direction { color: #60a5fa; } [data-bs-theme="dark"] .article-nav-title { color: #f9fafb; } [data-bs-theme="dark"] .author-bio-card { background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08)); border-color: rgba(59,130,246,0.25); } [data-bs-theme="dark"] .author-bio-title, [data-bs-theme="dark"] .author-name { color: #f9fafb; } [data-bs-theme="dark"] .author-job { color: #60a5fa; } [data-bs-theme="dark"] .author-photo { border-color: #1f2937; } [data-bs-theme="dark"] .author-photo-badge { border-color: #1f2937; } [data-bs-theme="dark"] .author-main-info { border-bottom-color: rgba(255,255,255,0.1); } [data-bs-theme="dark"] .info-icon { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15)); } [data-bs-theme="dark"] .info-content { color: #d1d5db; } [data-bs-theme="dark"] .info-content strong { color: #f9fafb; } [data-bs-theme="dark"] .expertise-tag { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15)); color: #60a5fa; border-color: rgba(59,130,246,0.3); } [data-bs-theme="dark"] .author-bio-text { background: rgba(255,255,255,0.03); border-start-color: #60a5fa; } [data-bs-theme="dark"] .author-bio-text p { color: #d1d5db; } [data-bs-theme="dark"] .article-share-section h4 { color: #f9fafb; } [data-bs-theme="dark"] .related-title { color: #f9fafb; border-bottom-color: rgba(96,165,250,0.2); } [data-bs-theme="dark"] .related-card { background: #1f2937; border-color: rgba(255,255,255,0.1); } [data-bs-theme="dark"] .related-card:hover { border-color: rgba(59,130,246,0.5); } [data-bs-theme="dark"] .related-card-title { color: #f9fafb; } [data-bs-theme="dark"] .related-card-meta { color: #9ca3af; } body { background: #0A0E14 !important; } .breadcrumb { background: transparent !important; } .breadcrumb-item a { color: #8a94a6; } .breadcrumb-item.active { color: #6B7689 !important; } .breadcrumb-item + .breadcrumb-item::before { color: #4a5260 !important; } .article-content-card { background: transparent !important; border: 0 !important; box-shadow: none !important; } .article-title { color: #F5F6F7 !important; } .article-meta { color: #8a94a6 !important; } .article-meta i { color: #19E3B1 !important; } .article-search { background: #11161F !important; border: 1px solid rgba(245,246,247,.12) !important; color: #F5F6F7 !important; } .article-search::placeholder { color: #6B7689 !important; } .articleBody { color: #C5CAD3 !important; } .articleBody h2, .articleBody h3, .articleBody h4 { color: #F5F6F7 !important; } .articleBody h2 { border-bottom-color: rgba(245,246,247,.10) !important; } .articleBody a { color: #19E3B1 !important; border-bottom-color: rgba(25,227,177,.35) !important; } .articleBody a:hover { color: #3BEBC0 !important; border-bottom-color: #3BEBC0 !important; } .articleBody ul li::marker { color: #19E3B1 !important; } .articleBody blockquote { background: rgba(25,227,177,.05) !important; border-start-color: #19E3B1 !important; color: #aeb6c2 !important; } .articleBody code { background: rgba(25,227,177,.12) !important; color: #3BEBC0 !important; } .articleBody pre { background: #11161F !important; border: 1px solid rgba(245,246,247,.08) !important; color: #c2c9d4 !important; } .articleBody pre code { color: #c2c9d4 !important; } .articleBody img { box-shadow: 0 10px 34px rgba(0,0,0,.5) !important; } .article-tldr { background: rgba(25,227,177,.07) !important; border: 1px solid rgba(25,227,177,.22) !important; border-start: 3px solid #19E3B1 !important; } .article-tldr-label { color: #19E3B1 !important; } .article-tldr p { color: #c2c9d4 !important; } .article-share-section h4 { color: #F5F6F7 !important; } .article-nav-link, .related-card { background: #1A2230 !important; border: 1px solid rgba(245,246,247,.08) !important; box-shadow: none !important; } .article-nav-link:hover, .related-card:hover { border-color: rgba(25,227,177,.35) !important; box-shadow: 0 16px 40px -16px rgba(0,0,0,.6) !important; } .article-nav-direction { color: #19E3B1 !important; } .article-nav-title, .related-card-title, .related-title { color: #F5F6F7 !important; } .related-title { border-bottom-color: rgba(245,246,247,.10) !important; } .related-card-meta { color: #6B7689 !important; } .related-card-meta i { color: #19E3B1 !important; } .author-bio-card { background: #11161F !important; border-color: rgba(245,246,247,.08) !important; } .author-bio-header { border-bottom-color: rgba(245,246,247,.10) !important; } .author-bio-title, .author-name { color: #F5F6F7 !important; } .author-job { color: #19E3B1 !important; } .author-bio-icon { background: #19E3B1 !important; } .author-bio-icon i { color: #0A0E14 !important; } .author-main-info { border-bottom-color: rgba(245,246,247,.08) !important; } .author-photo { border-color: #1A2230 !important; } .info-icon { background: rgba(25,227,177,.12) !important; } .info-icon i { color: #19E3B1 !important; } .info-content { color: #c2c9d4 !important; } .info-content strong { color: #8a94a6 !important; } .expertise-tag { background: rgba(25,227,177,.10) !important; color: #19E3B1 !important; border-color: rgba(25,227,177,.22) !important; } .author-bio-text { background: rgba(255,255,255,.03) !important; border-start-color: #19E3B1 !important; } .author-bio-text p, .achievements-list li, .author-bio-content { color: #aeb6c2 !important; }