From e7e696cd66d8eb6abd9477ca42a78f39d684ae92 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 9 Oct 2023 17:08:31 +0200 Subject: [PATCH] feat(rpc): add ipv6_only config --- apps/emqx_conf/src/emqx_conf_schema.erl | 10 ++++++++++ rel/i18n/emqx_conf_schema.hocon | 13 ++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 481eb59f2..7ec5348fc 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -957,6 +957,16 @@ fields("rpc") -> desc => ?DESC(rpc_listen_address), importance => ?IMPORTANCE_MEDIUM } + )}, + {"ipv6_only", + sc( + boolean(), + #{ + default => false, + mapping => "gen_rpc.ipv6_only", + desc => ?DESC(rpc_ipv6_only), + importance => ?IMPORTANCE_LOW + } )} ]; fields("log") -> diff --git a/rel/i18n/emqx_conf_schema.hocon b/rel/i18n/emqx_conf_schema.hocon index 13f852b3f..fde0f7ff3 100644 --- a/rel/i18n/emqx_conf_schema.hocon +++ b/rel/i18n/emqx_conf_schema.hocon @@ -195,11 +195,18 @@ rpc_insecure_fallback.label: """RPC insecure fallback""" rpc_listen_address.desc: -"""Specify which IP address the RPC server should listen on. -For example "0.0.0.0" (default) for IPv4 and "::" for IPv6""" +"""Indicates the IP address for the RPC server to listen on. For example, use "0.0.0.0" for IPv4 or "::" for IPv6.""" rpc_listen_address.label: -"""RPC Listen Address""" +"""RPC Listen IP Address""" + +rpc_ipv6_only.desc: +"""This setting is effective only when rpc.listen_address is assigned an IPv6 address. +If set to true, the RPC client will exclusively use IPv6 for connections. +Otherwise, the client might opt for IPv4, even if the server is on IPv6.""" + +rpc_ipv6_only.label: +"""Use IPv6 Only""" cluster_mcast_buffer.desc: """Size of the user-level buffer."""