English
The httpupgrade transport
HTTP/1.1 Upgrade without WebSocket frames: the client sends a GET with Upgrade: websocket, the server answers 101 Switching Protocols, after which the protocol stream goes over the connection as is. Cheaper than WebSocket (no framing), it passes through CDNs and proxies that understand Upgrade. Compatible with sing-box and Xray httpupgrade.
Fields
| Field | Type | Default | Meaning |
|---|---|---|---|
host | string | tls.sni, otherwise the server address | The request's Host; a server with host set accepts only that one (otherwise 400) |
path | string | / | The path; the server answers 404 to another path or method |
headers | mapping | — | Additional client headers; without User-Agent, a browser one is sent under utls, otherwise Go-http-client/1.1, as in sing-box |
As with ws, after 101 the server serves the stream without frames; given a Sec-WebSocket-Key from the client, it answers with a valid Sec-WebSocket-Accept.
Example
yaml
inbounds:
vless-hu:
vless:
listen: 127.0.0.1:10001
users:
- uuid: b831381d-6324-4d53-ad4f-8cda48b30811
transport:
httpupgrade:
path: /up
outbounds:
hu-out:
vless:
server: cdn.example.com:443
uuid: b831381d-6324-4d53-ad4f-8cda48b30811
tls:
sni: cdn.example.com
transport:
httpupgrade:
host: cdn.example.com
path: /up
route:
final:
outbound: hu-out