mirror of
https://github.com/openwrt/packages.git
synced 2025-12-27 04:39:58 +04:00
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 <cnsztl@project-openwrt.eu.org>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
config xray 'enabled'
|
||||
option enabled '0'
|
||||
option fullcone '1'
|
||||
|
||||
config xray 'config'
|
||||
option confdir '/etc/xray'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user