diff --git a/docs/config/transports/httpupgrade.md b/docs/config/transports/httpupgrade.md index e856956..dd61bab 100644 --- a/docs/config/transports/httpupgrade.md +++ b/docs/config/transports/httpupgrade.md @@ -11,7 +11,7 @@ { "acceptProxyProtocol": false, "path": "/", - "host": "xray.com" + "host": "xray.com", "headers": { "key": "value" } diff --git a/docs/en/config/transports/httpupgrade.md b/docs/en/config/transports/httpupgrade.md index 697e433..277b786 100644 --- a/docs/en/config/transports/httpupgrade.md +++ b/docs/en/config/transports/httpupgrade.md @@ -1,4 +1,4 @@ -# HttpUpgrade +# HTTPUpgrade A WebSocket-like transport protocol implementing the HTTP/1.1 upgrade and response, allowing it to be reverse proxied by web servers or CDNs just like WebSocket, but without the need to implement the remaining portions of the WebSocket protocol, yielding better performance. @@ -12,7 +12,10 @@ The `HttpUpgradeObject` corresponds to the `httpupgradeSettings` section under t { "acceptProxyProtocol": false, "path": "/", - "host": "xray.com" + "host": "xray.com", + "headers": { + "key": "value" + } } ``` @@ -30,6 +33,16 @@ When `true`, the downstream must first send PROXY protocol version 1 or 2 after HTTP path used by the HTTPUpgrade connection. Defaults to `"/"`. +If the `path` property include an `ed` query field (e.g. ```/mypath?ed=2560```), "early data" will be used to decrease latency, with the value defining the threshold of the first packet's size. If the size of the first packet exceeds the defined value, "early data" will not be applied. The recommended value is `2560`. + > `host`: string -HTTP Host sent by the HTTPUpgrade connection. Empty by default. \ No newline at end of file +HTTP Host sent by the HTTPUpgrade connection. Empty by default. If this value is empty on the server, the host header sent by clients will not be validated. + +If the `Host` header has been defined on the server in any way, the server will validate if the `Host` header matches. + +The current priority of the `Host` header sent by clients: ```host``` > ```headers``` > ```address``` + +> `headers`: map \{string: string\} + +Customized HTTP headers defined in key-value pairs. Defaults to empty. \ No newline at end of file