Skip to content

Commit

Permalink
xray-core: init: add browser dialer support
Browse files Browse the repository at this point in the history
Since v1.4.1, Xray has introduced a new feature to transfer data via
browsers, which can disguise itself as a normal browser to cheat
network censorship.

For more details, see XTLS/Xray-core#421.
  • Loading branch information
zxlhhyccc committed Apr 2, 2021
1 parent f2735fb commit af0c160
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lienol/xray-core/files/xray.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config xray 'config'
option confdir '/etc/xray'
list conffiles '/etc/xray/config.json'
option datadir '/usr/share/xray'
option dialer ''
option format 'json'

6 changes: 5 additions & 1 deletion lienol/xray-core/files/xray.init
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ start_service() {
local confdir
local conffiles
local datadir
local dialer
local format
local fullcone

config_get confdir "config" "confdir"
config_get conffiles "config" "conffiles"
config_get datadir "config" "datadir" "/usr/share/xray"
config_get dialer "config" "dialer"
config_get format "config" "format" "json"
config_get fullcone "enabled" "fullcone" "0"

procd_open_instance "$CONF"
procd_set_param command "$PROG" run
Expand All @@ -34,7 +37,8 @@ start_service() {
procd_append_param command -config "$i"
done
}
procd_append_param command -format "$format"
[ -n "$format" ] && procd_append_param command -format "$format"
[ -n "$dialer" ] && procd_set_param env XRAY_BROWSER_DIALER="$dialer"
[ "$fullcone" -eq "0" ] && procd_set_param env XRAY_CONE_DISABLED="true"
procd_set_param env XRAY_LOCATION_ASSET="$datadir"
procd_set_param file $conffiles
Expand Down

0 comments on commit af0c160

Please sign in to comment.