English
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| Transport | File | Compatibility | TLS needed |
|---|---|---|---|
ws | ws.md | sing-box, Xray, V2Ray | no |
grpc | grpc.md | sing-box, Xray (gun) | no (without TLS, unencrypted HTTP/2) |
http | http.md | sing-box (http), V2Ray h2 | no (without TLS, HTTP/1.1) |
httpupgrade | httpupgrade.md | sing-box, Xray | no |
xhttp | xhttp.md | Xray (SplitHTTP/XHTTP); not in sing-box | no |
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
tlsblock next totransport. Iftlshas noalpn, the transport's ALPN is used:h2forgrpcandhttp,http/1.1forwsandhttpupgrade, and forxhttpaccording to the chosen HTTP version. - VLESS
flow: xtls-rprx-visioncannot 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,
xmuxof XHTTP) is inside the transport; themuxblock works on top of it independently. - Durations are strings like
15s,1m; headers (headers) are a mapping "name → string or list of strings".