separate desync options for http and https

This commit is contained in:
bol-van
2021-03-20 13:03:47 +03:00
parent 17867c25b7
commit f6d80e78b4
12 changed files with 84 additions and 149 deletions

View File

@@ -21,14 +21,14 @@ PIDDIR=/var/run
NFQWS_USER=daemon
NFQWS="$ZAPRET_BASE/nfq/nfqws"
NFQWS_OPT_BASE="--qnum=$QNUM --user=$NFQWS_USER"
NFQWS_OPT_BASE="--user=$NFQWS_USER --dpi-desync-fwmark=$DESYNC_MARK"
TPWS="$ZAPRET_BASE/tpws/tpws"
TPWS_LOCALHOST4=127.0.0.127
HOSTLIST="$ZAPRET_BASE/ipset/zapret-hosts.txt.gz"
[ -f "$HOSTLIST" ] || HOSTLIST="$ZAPRET_BASE/ipset/zapret-hosts.txt"
[ -f "$HOSTLIST" ] || HOSTLIST="$ZAPRET_BASE/ipset/zapret-hosts-user.txt"
TPWS_OPT_BASE="--user=$TPWS_USER --port=$TPPORT"
TPWS_OPT_BASE="--user=$TPWS_USER"
TPWS_OPT_BASE4="--bind-addr=$TPWS_LOCALHOST4"
TPWS_OPT_BASE6="--bind-addr=::1"
TPWS_WAIT="--bind-wait-ifup=30 --bind-wait-ip=30"
@@ -99,20 +99,25 @@ start_service() {
case "${MODE}" in
tpws)
opt="$TPWS_OPT"
opt="--port=$TPPORT $TPWS_OPT"
filter_apply_hostlist_target opt
run_tpws 1 "$opt"
;;
tpws-socks)
opt="$TPWS_OPT_BASE --socks $TPWS_OPT"
opt="--port=$TPPORT $TPWS_OPT_BASE --socks $TPWS_OPT"
tpws_apply_socks_binds opt
filter_apply_hostlist_target opt
run_daemon 1 "$TPWS" "$opt"
;;
nfqws)
opt="$NFQWS_OPT_BASE $NFQWS_OPT_DESYNC"
opt="--qnum=$QNUM $NFQWS_OPT_BASE $NFQWS_OPT_DESYNC_HTTP"
filter_apply_hostlist_target opt
run_daemon 1 "$NFQWS" "$opt"
[ "$NFQWS_OPT_DESYNC_HTTP" = "$NFQWS_OPT_DESYNC_HTTPS" ] || {
opt="--qnum=$(($QNUM+1)) $NFQWS_OPT_BASE2 $NFQWS_OPT_DESYNC_HTTPS"
filter_apply_hostlist_target opt
run_daemon 2 "$NFQWS" "$opt"
}
;;
custom)
existf zapret_custom_daemons && zapret_custom_daemons $1