From 56b6ca5d09a757ef1a92265ca865dfb95eca91ea Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 12 Feb 2021 00:21:28 +0800 Subject: [PATCH] xray-core: init: add option to control FullConeNAT setting Latest version of xray-core made a change to support FullCone NAT, which would break UDP connection from v2ray-core backend server. So added the option for v2ray-core users, to make sure UDP works as expected. Signed-off-by: Tianling Shen --- net/xray-core/files/xray.conf | 1 + net/xray-core/files/xray.init | 3 +++ 2 files changed, 4 insertions(+) diff --git a/net/xray-core/files/xray.conf b/net/xray-core/files/xray.conf index d3d2728eee..aa742e6688 100644 --- a/net/xray-core/files/xray.conf +++ b/net/xray-core/files/xray.conf @@ -1,6 +1,7 @@ config xray 'enabled' option enabled '0' + option fullcone '1' config xray 'config' option confdir '/etc/xray' diff --git a/net/xray-core/files/xray.init b/net/xray-core/files/xray.init index 8ee5caa8f8..b6fe7043b2 100755 --- a/net/xray-core/files/xray.init +++ b/net/xray-core/files/xray.init @@ -18,11 +18,13 @@ start_service() { local conffiles local datadir local format + local fullcone config_get confdir "config" "confdir" config_get conffiles "config" "conffiles" config_get datadir "config" "datadir" "/usr/share/xray" config_get format "config" "format" "json" + config_get fullcone "enabled" "fullcone" "0" procd_open_instance "$CONF" procd_set_param command "$PROG" run @@ -34,6 +36,7 @@ start_service() { done } procd_append_param command -format "$format" + [ "$fullcone" -eq "0" ] && procd_set_param env XRAY_CONE_DISABLED="true" procd_set_param env XRAY_LOCATION_ASSET="$datadir" procd_set_param file $conffiles -- 2.30.2