Skip to content

Conversation

@tonya11en
Copy link
Member

This patch adds an optional config parameter for specifying a default
proxy address to be used by the transport socket if a proxy address is
not found in the filter state metadata. If the parameter is not set,
behavior of the transport socket remains identical to before this patch.

Risk Level: Low. New parameter.
Testing: unit/integration
Docs Changes: config documented
Release Notes: done
Platform Specific Features: n/a

This patch adds an optional config parameter for specifying a default
proxy address to be used by the transport socket if a proxy address is
not found in the filter state metadata. If the parameter is not set,
behavior of the transport socket remains identical to before this patch.

Signed-off-by: Tony Allen <[email protected]>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #42914 was opened by tonya11en.

see: more, trace.

@tonya11en tonya11en requested a review from kyessenov January 8, 2026 22:53
/**
* @return the default Http11ProxyInfo if configured, or nullopt.
*/
virtual absl::optional<TransportSocketOptions::Http11ProxyInfo> http11ProxyInfo() const PURE;
Copy link
Contributor

Choose a reason for hiding this comment

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

OptRef like the above options would probably be better (avoids copy of shared_ptr)


// Proxy address was not found in the metadata. If a default proxy address is set, return that.
const auto* proxy_config =
dynamic_cast<const Network::Http11ProxyConfiguration*>(&socket_factory);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm, wouldn't this break with nested factories (e.g. TLS over HTTP CONNECT)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Something like TLS over HTTP CONNECT would be configured as an http_11_proxy transport socket with a TLS transport socket configured as the inner/wrapped transport, right? The nested factories would have the http_11_proxy TS factory on the outside, so this should still work.

I just checked and the integration test actually uses TLS for the inner transport socket by default, so the inner socket is TLS for the integration test in this patch.

Copy link
Contributor

@kyessenov kyessenov Jan 9, 2026

Choose a reason for hiding this comment

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

I think it can be the other way: CONNECT inside TLS factory (e.g. HBONE thing from Istio). I think it's OK to accept this limitation, but we should make it clear in the docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

There should be an easy way to solve it? The config should be loaded into the factory and pass the default that way.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the xDS representation, the http_11_proxy transport socket is configured with a child, which would be the TLS transport socket. The TLS transport socket does not have a way to configure a child transport socket, so it can't be configured the other way.

I'm not sure how that config maps to the underlying Envoy implementation, though.

Signed-off-by: Tony Allen <[email protected]>
Signed-off-by: Tony Allen <[email protected]>
Copy link
Contributor

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Just a couple of quick drive-by comments from an xDS perspective...


// Proxy address was not found in the metadata. If a default proxy address is set, return that.
const auto* proxy_config =
dynamic_cast<const Network::Http11ProxyConfiguration*>(&socket_factory);
Copy link
Contributor

Choose a reason for hiding this comment

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

In the xDS representation, the http_11_proxy transport socket is configured with a child, which would be the TLS transport socket. The TLS transport socket does not have a way to configure a child transport socket, so it can't be configured the other way.

I'm not sure how that config maps to the underlying Envoy implementation, though.

Signed-off-by: Tony Allen <[email protected]>
/**
* @return the default Http11ProxyInfo if configured, or nullopt.
*/
virtual OptRef<const TransportSocketOptions::Http11ProxyInfo> http11ProxyInfo() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

call it defaultHttp11ProxyInfo similar to defaultSNI down below?

Signed-off-by: Tony Allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants