目录

CCF2026 ylong_http HTTPS Proxy Prototype

This submission contains two deliverables:

  1. A runnable, dependency-free Rust prototype crate that demonstrates a complete HTTPS-target proxy tunnel flow.
  2. A compile-checked patch for the official openharmony/commonlibrary_rust_ylong_http async connector path.

The prototype focuses on the contest’s minimum reproducible loop:

  • HTTP CONNECT host:port HTTP/1.1 request generation.
  • HTTPS target authority handling, defaulting to port 443.
  • Optional Proxy-Authorization: Basic ....
  • Proxy failure handling for 407, generic non-200 status codes, malformed responses, oversized headers, and timeout.
  • A simulated HTTPS-proxy handshake proving the ordering TCP -> proxy TLS -> CONNECT -> target tunnel.
  • A local tunnel round trip demo.

Repository Layout

.
|-- Cargo.toml
|-- src/
|   |-- lib.rs                         # Prototype client implementation
|   `-- main.rs                        # Loopback demo binary
|-- tests/proxy_flow.rs                # Integration tests with a local fake proxy
|-- patches/official_https_proxy_async.patch
|-- technical_solution.md
|-- testing.md
|-- usage.md
|-- demo_script.ps1
|-- submission_checklist.md
|-- final_report.md
`-- vendor/research/commonlibrary_rust_ylong_http/
    `-- ...                            # Shallow clone of official repo with patch applied

Quick Start

PowerShell:

Set-Location C:\CCFOpenSourcepowershell
Set-Location C:\CCFOpenSource\08_ylong_http_proxy
.\demo_script.ps1
8_ylong_http_proxy
.\demo_script.ps1

Manual commands:

$env:RUSTUP_HOME='C:\CCFOpenSourcepowershell
$env:RUSTUP_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.rustup'
$env:CARGO_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.cargo'
$env:PATH='C:\CCFOpenSource\08_ylong_http_proxy\.cargo\bin;' + $env:PATH
cargo test -- --nocapture
cargo run --bin proxy_demo
8_ylong_http_proxy\.rustup'
$env:CARGO_HOME='C:\CCFOpenSourcepowershell
$env:RUSTUP_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.rustup'
$env:CARGO_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.cargo'
$env:PATH='C:\CCFOpenSource\08_ylong_http_proxy\.cargo\bin;' + $env:PATH
cargo test -- --nocapture
cargo run --bin proxy_demo
8_ylong_http_proxy\.cargo'
$env:PATH='C:\CCFOpenSourcepowershell
$env:RUSTUP_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.rustup'
$env:CARGO_HOME='C:\CCFOpenSource\08_ylong_http_proxy\.cargo'
$env:PATH='C:\CCFOpenSource\08_ylong_http_proxy\.cargo\bin;' + $env:PATH
cargo test -- --nocapture
cargo run --bin proxy_demo
8_ylong_http_proxy\.cargo\bin;' + $env:PATH
cargo test -- --nocapture
cargo run --bin proxy_demo

Verification Snapshot

  • Prototype tests: 10 passed / 0 failed.
  • Covered scenarios: CONNECT, HTTPS target, Basic Auth, 407, 502, timeout, simulated HTTPS proxy TLS, tunnel round trip, URL parsing, Basic Auth encoding.
  • Prototype hot test run: 0.624s.
  • Official patch check:
    • cargo check -p ylong_http_client --features "async,http1_1,tokio_base,tls_default" passed.
    • cargo check -p ylong_http_client --features "async,http1_1,http2,tokio_base,tls_default" passed.

See testing.md and final_report.md for details.

Research Sources

关于
48.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号