From: Tianling Shen Date: Thu, 11 Feb 2021 16:21:28 +0000 (+0800) Subject: xray-core: init: add option to control FullConeNAT setting X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=56b6ca5d09a757ef1a92265ca865dfb95eca91ea;p=openwrt-packages.git 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 --- diff --git a/net/xray-core/files/xray.conf b/net/xray-core/files/xray.conf index d3d2728ee..aa742e668 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 8ee5caa8f..b6fe7043b 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