English
The http transport
The V2Ray/sing-box HTTP transport. With TLS it is HTTP/2: each protocol stream is the body of one HTTP/2 request (V2Ray h2); how streams share sessions is set by session_mode. Without TLS it is an HTTP/1.1 "camouflage": a request and a 200 answer, then the protocol stream in the same TCP connection. Compatible with sing-box http.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
host | string or list | — | Host names; the client picks one, the server accepts only these |
path | string | / | The request path |
method | string | PUT | The client's request method; a server with method set accepts only that one, without it any |
headers | mapping | — | Additional headers |
idle_timeout | duration | 0 (off) | After how much idleness to check the HTTP/2 session with a ping |
ping_timeout | duration | 15s | How long to wait for the ping answer |
session_mode | string | per_shard | As in grpc |
session_per_shard | bool | false | Deprecated: the same as session_mode: per_shard |
share_session | bool | false | Deprecated: the same as session_mode: shared |
The server accepts both HTTP/1.1 and HTTP/2 (prior knowledge or ALPN h2), checks the path, and, with host set, the host name. A request that does not fit is refused with an error code.
Example
yaml
inbounds:
vless-h2:
vless:
listen: ":443"
users:
- uuid: b831381d-6324-4d53-ad4f-8cda48b30811
tls:
certificate_path: /etc/ours/cert.pem
key_path: /etc/ours/key.pem
transport:
http:
host: [h2.example.com]
path: /h2
outbounds:
h2-out:
vless:
server: h2.example.com:443
uuid: b831381d-6324-4d53-ad4f-8cda48b30811
tls:
sni: h2.example.com
transport:
http:
host: h2.example.com
path: /h2
idle_timeout: 30s
route:
final:
outbound: h2-out