Skip to content

transport-httpupgrade ​

HTTPUpgrade: a checked HTTP/1.1 upgrade followed by a transparent tunnel. The client's early data goes right after the checked 101 response.

Crateours-mod-transport-httpupgrade, modules/transports/httpupgrade
Binary featuretransport-httpupgrade
Crate featuresnone

requires ​

transport — extends its point.

provides ​

  • Provide::Block { block: "transport", key: "httpupgrade" }.
  • Provide::Schema { name: "transport.httpupgrade" } — the fields of V2RayHTTPUpgradeOptions.

Syntax: HTTPUpgrade.

Dependencies ​

ours-transport-api, ours-proto (http1 — bounded handshake parsing), ours-api, ours-codec, base64, sha1, http, tokio.

Design ​

The whole module is src/lib.rs: Config, Options (checked options shared by all of the transport's connections), Client, Server.

Specifics ​

After the handshake the stream is the same socket (or kTLS stream) without wrappers: the server keeps splice support for TCP and kTLS, so the relay over HTTPUpgrade does not lose the hot path.

Tests ​

modules/transports/httpupgrade/tests/transport.rs.

GPL-3.0-or-later