Skip to content

Conversation

@howardjohn
Copy link
Collaborator

This was intentionally disabled as we did some major refactoring. Add it back now that things have stablized.

This was intentionally disabled as we did some major refactoring. Add it
back now that things have stablized.
@howardjohn howardjohn requested a review from a team as a code owner October 2, 2025 22:20
Copilot AI review requested due to automatic review settings October 2, 2025 22:20
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 revives the TCP proxy functionality that was previously disabled during major refactoring. The purpose is to restore TCP proxy mode now that the codebase has stabilized.

  • Restores TCP proxy route conversion and backend handling
  • Adds TCP connection support to the client module
  • Implements proper TCP proxy logic with bidirectional copying

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/agentgateway/src/types/local.rs Restores TCP route conversion logic and backend reference handling
crates/agentgateway/src/types/agent_xds.rs Adds missing alpn field to BackendTLS configuration
crates/agentgateway/src/test_helpers/proxymock.rs Adds TCP proxy test helpers and mock setup functions
crates/agentgateway/src/proxy/tcpproxy.rs Implements complete TCP proxy functionality with backend resolution
crates/agentgateway/src/proxy/mod.rs Adds TCP-specific error types for upstream call failures
crates/agentgateway/src/proxy/httpproxy.rs Refactors service call building into reusable function and makes structs public
crates/agentgateway/src/proxy/gateway_test.rs Adds basic TCP proxy test case
crates/agentgateway/src/proxy/gateway.rs Moves TCP metrics tracking to gateway level
crates/agentgateway/src/http/backendtls.rs Adds ALPN protocol configuration support
crates/agentgateway/src/client/mod.rs Adds TCP call support with bidirectional connection copying
crates/agentgateway/src/client/hyperrustls/mod.rs Renames HttpsConnector to TLSConnector for broader use

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +99 to +102
let service = match &selected_backend.backend {
SimpleBackend::Service(svc, _) => Some(strng::format!("{}/{}", svc.namespace, svc.hostname)),
_ => None,
};
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting this service name formatting logic into a helper function since it may be reused elsewhere in the codebase.

Copilot uses AI. Check for mistakes.
return Err(ProxyError::NoHealthyEndpoints);
};
let dest = SocketAddr::from((*ip, target_port));
log.add(move |l| l.request_handle = Some(handle));
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

The log parameter is &mut Option<&mut RequestLog> but this code assumes it's always Some. This will panic if log is None.

Suggested change
log.add(move |l| l.request_handle = Some(handle));
if let Some(log) = log {
log.add(move |l| l.request_handle = Some(handle));
}

Copilot uses AI. Check for mistakes.
use http_body_util::BodyExt;
use hyper_util_fork::rt::TokioIo;
use rustls_pki_types::{DnsName, ServerName};
use tonic::codegen::Service;
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

This import appears to be unused in the context of the changes shown. Consider removing if not needed.

Suggested change
use tonic::codegen::Service;

Copilot uses AI. Check for mistakes.
@howardjohn howardjohn merged commit 6d711cb into agentgateway:main Oct 3, 2025
7 checks passed
artberger added a commit to agentgateway/website that referenced this pull request Oct 15, 2025
Followup to agentgateway/agentgateway#496

Signed-off-by: Art Berger <art.berger@solo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant