Skip to content

Conversation

@ohah
Copy link
Owner

@ohah ohah commented Oct 25, 2025

터널 응답 수정 및 리드미 수정

ohah added 5 commits October 25, 2025 20:20
- 터널 내부의 실제 HTTP 요청(GET/POST 등) 감지 및 파싱
- HTTP 요청과 응답의 올바른 매칭을 위한 요청 ID 추적
- 터널 이벤트 전송 기능으로 UI에 실제 HTTP 요청 표시
- CONNECT 요청은 터널 설정용이므로 UI 표시 제외
- 터널 모드에서 처리할 도메인 목록에 setup.icloud.com 추가
- Apple 서비스의 터널 모드 지원 확장
- CONNECT 요청은 터널 설정용이므로 UI에 표시하지 않음
- 터널 내부의 실제 HTTP 요청만 UI에 표시하도록 개선
- 터널 모드에서 실제 HTTP 요청/응답 처리 로직 분리
- CONNECT 요청의 host:port 형식 URI 올바른 파싱
- 네트워크 테이블에서 CONNECT 요청 URL 표시 개선
- 터널 모드 요청의 authority 및 pathname 처리 로직 개선
@ohah ohah self-assigned this Oct 25, 2025
@ohah ohah added bug Something isn't working documentation Improvements or additions to documentation labels Oct 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies tunnel response handling and updates the README. The main focus is on improving CONNECT request handling in the proxy and cleaning up documentation.

Key changes:

  • Enhanced CONNECT request handling to properly parse and display tunnel traffic in the UI
  • Added HTTP request/response parsing within tunnels for better monitoring
  • Removed outdated screenshots and build badge from README

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tauri-ui/src/widgets/network-table/lib/utils.ts Added special handling for CONNECT requests in getAuthority() to return host:port format directly
tauri-ui/src/widgets/network-table/hooks/use-table-data.ts Added CONNECT request detection to properly extract authority and pathname
tauri-ui/src-tauri/src/proxy_v2.rs Added early return for CONNECT requests to prevent UI display and imported additional HTTP types
crates/proxyapi_v2/src/proxy/internal.rs Added HTTP parsing functions for tunnel traffic monitoring and integrated tunnel event sending
crates/proxyapi_v2/src/hybrid_tls_handler.rs Added "setup.icloud.com" to tunnel domain list
README.md Removed build badge and screenshots section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);

// 가장 최근 요청 ID를 사용하여 응답 매칭
let response_request_id = if let Some((latest_request_id, _)) = pending_requests.iter().last() {
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using iter().last() on a HashMap is unreliable because HashMap iteration order is not deterministic. This could result in matching responses to incorrect requests. Consider using a VecDeque or maintaining insertion order with IndexMap to ensure proper request-response pairing.

Copilot uses AI. Check for mistakes.
Comment on lines +1020 to +1022
let host = headers.get("host")
.map(|h| h.split(':').next().unwrap_or(h))
.unwrap_or_else(|| target_addr.split(':').next().unwrap_or("unknown"));
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The nested unwrap_or calls make this code difficult to read. Consider extracting this logic into a helper function or simplifying with pattern matching for better clarity.

Copilot uses AI. Check for mistakes.
Comment on lines +1026 to +1028
use proxy_v2_models::{ProxiedRequest, ProxiedResponse};
use hyper::{StatusCode, Version};
use http::HeaderMap;
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports are duplicated from the module-level imports at lines 21-22. The local imports should be removed to avoid redundancy.

Suggested change
use proxy_v2_models::{ProxiedRequest, ProxiedResponse};
use hyper::{StatusCode, Version};
use http::HeaderMap;

Copilot uses AI. Check for mistakes.
Comment on lines +1130 to +1133
use proxy_v2_models::{ProxiedRequest, ProxiedResponse};
use hyper::{StatusCode, Version};
use http::HeaderMap;

Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports are duplicated from the module-level imports at lines 21-22. The local imports should be removed to avoid redundancy.

Suggested change
use proxy_v2_models::{ProxiedRequest, ProxiedResponse};
use hyper::{StatusCode, Version};
use http::HeaderMap;

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +22
// CONNECT 요청의 경우 host:port 형식이므로 그대로 반환
if (uri.includes(':') && !uri.startsWith('http')) {
return uri;
}
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is duplicated in both the try block (lines 12-14) and catch block (lines 20-22). Consider extracting it into a helper function to eliminate duplication.

Copilot uses AI. Check for mistakes.
@ohah ohah merged commit a61f028 into master Nov 2, 2025
2 checks passed
@ohah ohah deleted the fix/ternel branch November 2, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants