Skip to content

ours-uot ​

crates/uot — UDP-over-TCP v1/v2 (sing's common/uot): packet framing in a stream for protocols that carry UDP in a TCP connection to one of two "magic" destination addresses.

API ​

  • MAGIC_V1, MAGIC_V2 — the magic domains; version_of(destination) — which version a stream to this address asks for.
  • request(destination) — the v2 request the client writes after connecting to the magic address: packets carry their own addresses, destination is the first of them.
  • PacketStream::new(stream) — the client side; PacketStream::server(stream, version) — the server side; first_destination — the address of the first packet.

Who uses it ​

ours-mod-socks, ours-proto (socks-server), ours-mod-anytls, ours-mod-tuic, ours-mod-shadowsocks (the outbounds' udp_over_tcp option and the server side).

Specifics ​

Depends on ours-api, ours-bufpool, ours-wire, tokio.

Tests ​

No unit tests; fuzz targets in fuzz/ (packets, roundtrip); the rest is checked by the tests of the modules that use it.

GPL-3.0-or-later