English
transport
The transport point: the layer under a protocol (VLESS, Trojan) that turns one connection into the protocol's byte stream, hiding WebSocket frames, an HTTP Upgrade, HTTP requests or a gRPC message stream. The protocol writes and reads bytes and knows nothing about the transport. The interface protocols and transports meet on is the contract ours-transport-api; the module keeps the point and the transport over QUIC. The HTTP/2 layer of the HTTP-based transports is ours_proto::h2 (the h2 feature of ours-proto).
| Crate | ours-mod-transport, modules/transports/transport |
| Binary feature | none, always in the build |
| Crate features | quic — the transport over QUIC (src/quic.rs, ours-quic, ours-transport-api/quic), the variant quic of the point; the binary enables it with transport-xhttp; without it a transport over QUIC is refused |
requires
dial, tls. It is required by the transports (transport-*, they extend the point) and by the protocols that take a transport from the blocks (trojan, vless).
provides
Provide::Point("transport"). The variants are added by the transport modules:Provide::Block { block: "transport", key: "ws" | "http" | "grpc" | "httpupgrade" | "xhttp" }and the schemastransport.<kind>.Provide::Extension { point: "transport", key: "quic" }, aours_transport_api::Quic<ListenOptions>:dialgives what dials HTTP/3 for an outbound's transport,listen— theQuicListenerof an inbound whose transport takes QUIC; both take the QUIC TLS (ours_quic::tls::Factory) from the services.vlesstakes it fromExtensions. Built withoutquic, the variant is there and refuses: «a transport over QUIC needs the transport featurequic» (a module provides the same in every build).
Neither the protocol nor the transport names the other: the protocol says what it needs (Caps), the transport — what it gives.
What the module keeps (src/lib.rs, src/quic.rs)
MODULEand the schema of thetransportblock (thetransport.<kind>schemas of the variants).src/quic.rs(featurequic) — the variantquic: the HTTP/3 dial and the listener over QUIC; without the feature, the refusing variant insrc/lib.rs.
Dependencies
ours-transport-api, ours-api, ours-config, ours-json, ours-tls-options; with quic — ours-quic, ours-runtime, tokio, tracing.
Tests
A unit test in src/lib.rs (the variant quic is found by its type); the interface is tested in ours-transport-api, QUIC — by transport-xhttp and the interop scenarios of vless.
Syntax: transports.