Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Breaking changes:

- api: replace the ``drainConnections()`` method with a broader ``resetConnectivityState()``. (:issue:`#2225 <2225>`).
- api: disallow setting 'host' header directly (:issue:`#2275 <2275>`)
- api: add experimental option to force all connections to use IPv6 (:issue: `#2379 <2379>`, :issue: `#2396 <2396>`)
- android: respect Android's NetworkSecurityPolicy isCleartextTrafficPermitted APIs.
- net: enable happy eyeballs by default (:issue:`#2272 <2272>`)
- iOS: remove support for installing via CocoaPods, which had not worked since 2020 (:issue:`#2215 <2215>`)
Expand Down Expand Up @@ -47,6 +46,8 @@ Features:
- api: improved C++ APIs compatibility with Java / Kotlin / Swift (:issue `#2362 <2362>`)
- api: add option to use the a ``getaddrinfo``-based system DNS resolver instead of c-ares (:issue: `#2419 <2419>`)
- iOS: add ``KeyValueStore`` protocol conformance to ``UserDefaults`` (:issue: `#2452 <2452>`)
- iOS: add experimental option to force all connections to use IPv6. (:issue: `#2396 <2396>`)
- android: force the use of IPv6 addresses for all connections. (:issue: `#2510 <2510>`)

0.4.6 (April 26, 2022)
========================
Expand Down
48 changes: 25 additions & 23 deletions library/cc/engine_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,29 +146,31 @@ std::string EngineBuilder::generateConfigStr() {
}
#endif

std::vector<std::pair<std::string, std::string>> replacements{
{"connect_timeout", fmt::format("{}s", this->connect_timeout_seconds_)},
{"dns_fail_base_interval", fmt::format("{}s", this->dns_failure_refresh_seconds_base_)},
{"dns_fail_max_interval", fmt::format("{}s", this->dns_failure_refresh_seconds_max_)},
{"dns_preresolve_hostnames", this->dns_preresolve_hostnames_},
{"dns_refresh_rate", fmt::format("{}s", this->dns_refresh_seconds_)},
{"dns_query_timeout", fmt::format("{}s", this->dns_query_timeout_seconds_)},
{"dns_resolver_name", dns_resolver_name},
{"dns_resolver_config", dns_resolver_config},
{"h2_connection_keepalive_idle_interval",
fmt::format("{}s", this->h2_connection_keepalive_idle_interval_milliseconds_ / 1000.0)},
{"h2_connection_keepalive_timeout",
fmt::format("{}s", this->h2_connection_keepalive_timeout_seconds_)},
{
"metadata",
fmt::format("{{ device_os: {}, app_version: {}, app_id: {} }}", this->device_os_,
this->app_version_, this->app_id_),
},
{"stats_domain", this->stats_domain_},
{"stats_flush_interval", fmt::format("{}s", this->stats_flush_seconds_)},
{"stream_idle_timeout", fmt::format("{}s", this->stream_idle_timeout_seconds_)},
{"per_try_idle_timeout", fmt::format("{}s", this->per_try_idle_timeout_seconds_)},
{"virtual_clusters", this->virtual_clusters_},
std::vector<std::pair<std::string, std::string>> replacements {
{"connect_timeout", fmt::format("{}s", this->connect_timeout_seconds_)},
{"dns_fail_base_interval", fmt::format("{}s", this->dns_failure_refresh_seconds_base_)},
{"dns_fail_max_interval", fmt::format("{}s", this->dns_failure_refresh_seconds_max_)},
{"dns_preresolve_hostnames", this->dns_preresolve_hostnames_},
{"dns_refresh_rate", fmt::format("{}s", this->dns_refresh_seconds_)},
{"dns_query_timeout", fmt::format("{}s", this->dns_query_timeout_seconds_)},
{"dns_resolver_name", dns_resolver_name}, {"dns_resolver_config", dns_resolver_config},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we keep these on two lines?

Suggested change
{"dns_resolver_name", dns_resolver_name}, {"dns_resolver_config", dns_resolver_config},
{"dns_resolver_name", dns_resolver_name},
{"dns_resolver_config", dns_resolver_config},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it's a linter tool that made a change in here. It does not allow me to make a change from your suggestion.

For reference, I ran ./tools/code_format/check_format.py fix ../library/ from within envoy directory locally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

huh, interesting that it was previously on two lines.

{"h2_connection_keepalive_idle_interval",
fmt::format("{}s", this->h2_connection_keepalive_idle_interval_milliseconds_ / 1000.0)},
{"h2_connection_keepalive_timeout",
fmt::format("{}s", this->h2_connection_keepalive_timeout_seconds_)},
{
"metadata",
fmt::format("{{ device_os: {}, app_version: {}, app_id: {} }}", this->device_os_,
this->app_version_, this->app_id_),
},
{"stats_domain", this->stats_domain_},
{"stats_flush_interval", fmt::format("{}s", this->stats_flush_seconds_)},
{"stream_idle_timeout", fmt::format("{}s", this->stream_idle_timeout_seconds_)},
{"per_try_idle_timeout", fmt::format("{}s", this->per_try_idle_timeout_seconds_)},
{"virtual_clusters", this->virtual_clusters_},
#if defined(__ANDROID_API__)
{"force_ipv6", "true"},
#endif
};

// NOTE: this does not include support for custom filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public enum TrustChainVerification {
public final Boolean enableSocketTagging;
public final Boolean enableHappyEyeballs;
public final Boolean enableInterfaceBinding;
public final Boolean forceIPv6;
public final Integer h2ConnectionKeepaliveIdleIntervalMilliseconds;
public final Integer h2ConnectionKeepaliveTimeoutSeconds;
public final Boolean h2ExtendKeepaliveTimeout;
Expand Down Expand Up @@ -88,7 +87,6 @@ public enum TrustChainVerification {
* @param enableSocketTagging whether to enable socket tagging.
* @param enableHappyEyeballs whether to enable RFC 6555 handling for IPv4/IPv6.
* @param enableInterfaceBinding whether to allow interface binding.
* @param forceIPv6 whether to force connections to use IPv6.
* @param h2ConnectionKeepaliveIdleIntervalMilliseconds rate in milliseconds seconds to send h2
* pings on stream creation.
* @param h2ConnectionKeepaliveTimeoutSeconds rate in seconds to timeout h2 pings.
Expand Down Expand Up @@ -116,12 +114,12 @@ public EnvoyConfiguration(
boolean dnsFilterUnroutableFamilies, boolean dnsUseSystemResolver,
boolean enableDrainPostDnsRefresh, boolean enableHttp3, boolean enableGzip,
boolean enableBrotli, boolean enableSocketTagging, boolean enableHappyEyeballs,
boolean enableInterfaceBinding, boolean forceIPv6,
int h2ConnectionKeepaliveIdleIntervalMilliseconds, int h2ConnectionKeepaliveTimeoutSeconds,
boolean h2ExtendKeepaliveTimeout, List<String> h2RawDomains, int maxConnectionsPerHost,
int statsFlushSeconds, int streamIdleTimeoutSeconds, int perTryIdleTimeoutSeconds,
String appVersion, String appId, TrustChainVerification trustChainVerification,
String virtualClusters, List<EnvoyNativeFilterConfig> nativeFilterChain,
boolean enableInterfaceBinding, int h2ConnectionKeepaliveIdleIntervalMilliseconds,
int h2ConnectionKeepaliveTimeoutSeconds, boolean h2ExtendKeepaliveTimeout,
List<String> h2RawDomains, int maxConnectionsPerHost, int statsFlushSeconds,
int streamIdleTimeoutSeconds, int perTryIdleTimeoutSeconds, String appVersion, String appId,
TrustChainVerification trustChainVerification, String virtualClusters,
List<EnvoyNativeFilterConfig> nativeFilterChain,
List<EnvoyHTTPFilterFactory> httpPlatformFilterFactories,
Map<String, EnvoyStringAccessor> stringAccessors,
Map<String, EnvoyKeyValueStore> keyValueStores) {
Expand All @@ -145,7 +143,6 @@ public EnvoyConfiguration(
this.enableSocketTagging = enableSocketTagging;
this.enableHappyEyeballs = enableHappyEyeballs;
this.enableInterfaceBinding = enableInterfaceBinding;
this.forceIPv6 = forceIPv6;
this.h2ConnectionKeepaliveIdleIntervalMilliseconds =
h2ConnectionKeepaliveIdleIntervalMilliseconds;
this.h2ConnectionKeepaliveTimeoutSeconds = h2ConnectionKeepaliveTimeoutSeconds;
Expand Down Expand Up @@ -274,7 +271,7 @@ String resolveTemplate(final String configTemplate, final String platformFilterT
enableDrainPostDnsRefresh ? "true" : "false"))
.append(String.format("- &enable_interface_binding %s\n",
enableInterfaceBinding ? "true" : "false"))
.append(String.format("- &force_ipv6 %s\n", forceIPv6 ? "true" : "false"))
.append("- &force_ipv6 true\n")
.append(String.format("- &h2_connection_keepalive_idle_interval %ss\n",
h2ConnectionKeepaliveIdleIntervalMilliseconds / 1000.0))
.append(String.format("- &h2_connection_keepalive_timeout %ss\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class NativeCronetEngineBuilderImpl extends CronetEngineBuilderImpl {
private boolean mEnableSocketTag = true;
private boolean mEnableHappyEyeballs = false;
private boolean mEnableInterfaceBinding = false;
private boolean mForceIPv6 = false;
private int mH2ConnectionKeepaliveIdleIntervalMilliseconds = 100000000;
private int mH2ConnectionKeepaliveTimeoutSeconds = 10;
private boolean mH2ExtendKeepaliveTimeout = false;
Expand Down Expand Up @@ -110,7 +109,7 @@ private EnvoyConfiguration createEnvoyConfiguration() {
mDnsQueryTimeoutSeconds, mDnsMinRefreshSeconds, mDnsPreresolveHostnames,
mDnsFallbackNameservers, mEnableDnsFilterUnroutableFamilies, mDnsUseSystemResolver,
mEnableDrainPostDnsRefresh, quicEnabled(), mEnableGzip, brotliEnabled(), mEnableSocketTag,
mEnableHappyEyeballs, mEnableInterfaceBinding, mForceIPv6,
mEnableHappyEyeballs, mEnableInterfaceBinding,
mH2ConnectionKeepaliveIdleIntervalMilliseconds, mH2ConnectionKeepaliveTimeoutSeconds,
mH2ExtendKeepaliveTimeout, mH2RawDomains, mMaxConnectionsPerHost, mStatsFlushSeconds,
mStreamIdleTimeoutSeconds, mPerTryIdleTimeoutSeconds, mAppVersion, mAppId,
Expand Down
15 changes: 0 additions & 15 deletions library/kotlin/io/envoyproxy/envoymobile/EngineBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ open class EngineBuilder(
private var enableBrotli = false
private var enableSocketTagging = false
private var enableInterfaceBinding = false
private var forceIPv6 = false
private var h2ConnectionKeepaliveIdleIntervalMilliseconds = 1
private var h2ConnectionKeepaliveTimeoutSeconds = 10
private var h2ExtendKeepaliveTimeout = false
Expand Down Expand Up @@ -327,19 +326,6 @@ open class EngineBuilder(
return this
}

/**
* Specify whether to remap IPv4 addresses to the IPv6 space and always force connections
* to use IPv6. Note this is an experimental option and should be enabled with caution.
*
* @param forceIPv6 whether to force connections to use IPv6.
*
* @return This builder.
*/
fun forceIPv6(forceIPv6: Boolean): EngineBuilder {
this.forceIPv6 = forceIPv6
return this
}

/**
* Add a rate at which to ping h2 connections on new stream creation if the connection has
* sat idle. Defaults to 1 millisecond which effectively enables h2 ping functionality
Expand Down Expand Up @@ -629,7 +615,6 @@ open class EngineBuilder(
enableSocketTagging,
enableHappyEyeballs,
enableInterfaceBinding,
forceIPv6,
h2ConnectionKeepaliveIdleIntervalMilliseconds,
h2ConnectionKeepaliveTimeoutSeconds,
h2ExtendKeepaliveTimeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class EnvoyConfigurationTest {
enableSocketTagging: Boolean = false,
enableHappyEyeballs: Boolean = false,
enableInterfaceBinding: Boolean = false,
forceIPv6: Boolean = false,
h2ConnectionKeepaliveIdleIntervalMilliseconds: Int = 222,
h2ConnectionKeepaliveTimeoutSeconds: Int = 333,
h2ExtendKeepaliveTimeout: Boolean = false,
Expand Down Expand Up @@ -102,7 +101,6 @@ class EnvoyConfigurationTest {
enableSocketTagging,
enableHappyEyeballs,
enableInterfaceBinding,
forceIPv6,
h2ConnectionKeepaliveIdleIntervalMilliseconds,
h2ConnectionKeepaliveTimeoutSeconds,
h2ExtendKeepaliveTimeout,
Expand Down Expand Up @@ -150,7 +148,7 @@ class EnvoyConfigurationTest {
assertThat(resolvedTemplate).contains("&enable_interface_binding false")

// Forcing IPv6
assertThat(resolvedTemplate).contains("&force_ipv6 false")
assertThat(resolvedTemplate).contains("&force_ipv6 true")

// H2 Ping
assertThat(resolvedTemplate).contains("&h2_connection_keepalive_idle_interval 0.222s")
Expand Down Expand Up @@ -205,7 +203,6 @@ class EnvoyConfigurationTest {
enableGzip = false,
enableBrotli = true,
enableInterfaceBinding = true,
forceIPv6 = true,
h2ExtendKeepaliveTimeout = true
)

Expand Down Expand Up @@ -233,9 +230,6 @@ class EnvoyConfigurationTest {

// Interface Binding
assertThat(resolvedTemplate).contains("&enable_interface_binding true")

// Forcing IPv6
assertThat(resolvedTemplate).contains("&force_ipv6 true")
}

@Test
Expand Down
1 change: 0 additions & 1 deletion test/kotlin/apps/experimental/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class MainActivity : Activity() {
.h2ExtendKeepaliveTimeout(true)
.enableInterfaceBinding(true)
.enableDNSUseSystemResolver(true)
.forceIPv6(true)
.enableSocketTagging(true)
.addNativeFilter("envoy.filters.http.buffer", "{\"@type\":\"type.googleapis.com/envoy.extensions.filters.http.buffer.v3.Buffer\",\"max_request_bytes\":5242880}")
.addStringAccessor("demo-accessor", { "PlatformString" })
Expand Down