[P2][refactor] manual HTTP server를 Hyper/Tower 기반으로 전환 검토 #39

Closed
opened 2026-05-02 04:34:10 +00:00 by boxqkrtm · 1 comment

문제

현재 request parsing/response handling을 수작업 HTTP parser 중심으로 처리합니다. 이로 인해 body limit, timeout, CORS, auth, tracing, error mapping 같은 횡단 관심사를 endpoint마다 누락 없이 적용하기 어렵습니다.

관련 후보:

  • crates/portal-relay/src/relay/server.rs
  • crates/portal-relay/src/api/*

제안

  • Hyper server로 HTTP parsing 위임
  • Tower middleware로 body limit, timeout, auth, tracing, error mapping 구성
  • public API와 admin API listener 분리 가능성 검토
  • raw TCP/SNI/UDP relay path와 HTTP API path 경계 명확화

완료 기준

  • request body/read timeout/security policy가 middleware로 일관 적용
  • manual parser edge case 부담 감소
  • 기존 Go compatibility/smoke script 통과

검토 기준: 업로드된 Rust portal-relay 코드 정적 리뷰. 리뷰 환경에서는 cargo check/test/clippy를 실행하지 못했습니다.

## 문제 현재 request parsing/response handling을 수작업 HTTP parser 중심으로 처리합니다. 이로 인해 body limit, timeout, CORS, auth, tracing, error mapping 같은 횡단 관심사를 endpoint마다 누락 없이 적용하기 어렵습니다. 관련 후보: - `crates/portal-relay/src/relay/server.rs` - `crates/portal-relay/src/api/*` ## 제안 - Hyper server로 HTTP parsing 위임 - Tower middleware로 body limit, timeout, auth, tracing, error mapping 구성 - public API와 admin API listener 분리 가능성 검토 - raw TCP/SNI/UDP relay path와 HTTP API path 경계 명확화 ## 완료 기준 - request body/read timeout/security policy가 middleware로 일관 적용 - manual parser edge case 부담 감소 - 기존 Go compatibility/smoke script 통과 --- 검토 기준: 업로드된 Rust `portal-relay` 코드 정적 리뷰. 리뷰 환경에서는 `cargo check/test/clippy`를 실행하지 못했습니다.
Owner

검토했지만 이번 범위에서는 수용하지 않습니다. Hyper/Tower 전환은 장기적으로 가능하지만 서버 parsing 전체 교체는 회귀 위험이 큽니다. 이번에는 manual parser에 body cap/read timeout/error mapping을 PR #62로 보강했으므로 전환 검토 이슈는 닫습니다.

검토했지만 이번 범위에서는 수용하지 않습니다. Hyper/Tower 전환은 장기적으로 가능하지만 서버 parsing 전체 교체는 회귀 위험이 큽니다. 이번에는 manual parser에 body cap/read timeout/error mapping을 PR #62로 보강했으므로 전환 검토 이슈는 닫습니다.
gofix closed this issue 2026-05-03 18:58:42 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gofix/portal-tunnel-rs#39
No description provided.