@@ -36,6 +36,7 @@ A high-performance proxy server built with Rust, supporting HTTP/HTTPS and WebSo
3636 - [ Option 1: With Docker Services (Recommended)] ( #option-1-with-docker-services-recommended )
3737 - [ Option 2: Manual Service Management] ( #option-2-manual-service-management )
3838 - [ Option 3: Individual Test Suites] ( #option-3-individual-test-suites )
39+ - [ Streaming Tests] ( #streaming-tests )
3940 - [ Test Services] ( #test-services )
4041 - [ Benefits of Docker-Based Testing] ( #benefits-of-docker-based-testing )
4142 - [ CI/CD] ( #cicd )
@@ -56,6 +57,7 @@ A high-performance proxy server built with Rust, supporting HTTP/HTTPS and WebSo
5657
5758- 🚀 ** High-Performance Async Proxy** : Built on Tokio and Axum
5859- 🔄 ** Protocol Support** : Supports HTTP/HTTPS and WebSocket proxying
60+ - 🌊 ** Streaming Support** : Native support for streaming responses (SSE, LLM APIs, chunked encoding)
5961- 💾 ** Session Management** : Uses SQLite database to store session information
6062- 🎯 ** Dynamic Routing** : Dynamically forwards to different downstream servers based on session_id
6163- ⚡ ** Connection Pooling** : Built-in database connection pool and HTTP client connection pool
@@ -401,10 +403,33 @@ cargo test --test integration
401403
402404# Hurl HTTP API tests only (requires services running)
403405hurl --test --variable port=8080 tests/http.hurl
406+
407+ # Streaming response tests (独立测试)
408+ ./test_streaming.sh
404409```
405410
406411** Note:** WebSocket tests are only available in Rust integration tests (` tests/integration.rs ` ), as Hurl doesn't support WebSocket message protocol.
407412
413+ #### Streaming Tests
414+
415+ 流式传输测试验证 ss-proxy 对流式响应的支持,包括 LLM API(如 OpenAI)的流式输出:
416+
417+ ``` bash
418+ # 运行完整的流式传输测试套件
419+ ./test_streaming.sh
420+
421+ # 使用自定义端口
422+ TEST_PROXY_PORT=9090 TEST_MOCK_PORT=10087 ./test_streaming.sh
423+ ```
424+
425+ 测试覆盖:
426+ - ✅ 非流式请求转发 (` stream=false ` )
427+ - ✅ 流式请求转发 (` stream=true ` )
428+ - ✅ SSE (Server-Sent Events) 格式验证
429+ - ✅ 首字节延迟 (TTFB) 性能测试
430+
431+ 详见:[ 流式传输测试文档] ( tests/STREAMING_TEST_README.md )
432+
408433### Test Services
409434
410435The test suite uses the following Docker services (all run locally):
@@ -427,10 +452,17 @@ All services are automatically managed by `run_tests.sh` when `USE_DOCKER_SERVIC
427452
428453### CI/CD
429454
430- The project includes a GitHub Actions workflow (` .github/workflows/test.yml ` ) that automatically:
455+ The project includes GitHub Actions workflows that automatically:
456+
457+ ** Test Workflow** (` .github/workflows/test.yml ` ):
431458- Runs all tests on push/PR
459+ - Two independent test jobs:
460+ - ` test ` : HTTP/HTTPS and WebSocket proxy tests
461+ - ` streaming-test ` : Streaming response tests (新增)
432462- Uses service containers for test dependencies
433463- Caches Rust dependencies for faster builds
464+
465+ ** Build Workflow** (` .github/workflows/build.yml ` ):
434466- Runs linting and formatting checks
435467- Builds binaries for multiple platforms
436468
0 commit comments