Skip to content

Transports ​

A transport is a layer between the protocol and TCP/TLS: the protocol (VLESS, Trojan) writes its stream not directly into TLS but inside WebSocket, gRPC, HTTP/2 or XHTTP. This lets it pass through CDNs and reverse proxies that understand only HTTP.

The transport is set by the transport block inside the protocol block. The kind of transport is the key inside the block; there is no type field (transport: {type: ws} gives unknown transport `type` ).

yaml
outbounds:
  proxy:
    trojan:
      server: cdn.example.com:443
      password: secret
      tls:
        sni: cdn.example.com
      transport:
        ws:
          path: /ws
route:
  final:
    outbound: proxy
TransportFileCompatibilityTLS needed
wsws.mdsing-box, Xray, V2Rayno
grpcgrpc.mdsing-box, Xray (gun)no (without TLS, unencrypted HTTP/2)
httphttp.mdsing-box (http), V2Ray h2no (without TLS, HTTP/1.1)
httpupgradehttpupgrade.mdsing-box, Xrayno
xhttpxhttp.mdXray (SplitHTTP/XHTTP); not in sing-boxno

Only the vless and trojan protocols take a transport, on inbound and outbound. The sing-box quic transport is not supported.

Common behavior ​

  • TLS is set by the ordinary tls block next to transport. If tls has no alpn, the transport's ALPN is used: h2 for grpc and http, http/1.1 for ws and httpupgrade, and for xhttp according to the chosen HTTP version.
  • VLESS flow: xtls-rprx-vision cannot be used with a transport (except with VLESS Encryption): flow: Vision over transports is not supported.
  • The transport's multiplexing (HTTP/2 sessions of gRPC/HTTP, xmux of XHTTP) is inside the transport; the mux block works on top of it independently.
  • Durations are strings like 15s, 1m; headers (headers) are a mapping "name → string or list of strings".

GPL-3.0-or-later