diff --git a/Dockerfile b/Dockerfile index 8744621..ffb9f59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM golang:1.22-alpine3.20 AS builder +FROM golang:1.23-alpine3.20 AS builder -ARG XRAY_VER='v1.8.24' +ARG XRAY_VER='v1.8.23' ARG QREC_VER='4.1.1' RUN apk add --no-cache bash git build-base wget @@ -46,22 +46,26 @@ RUN apk --no-cache add bash openssl curl jq moreutils \ RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf -ADD proxy-lx.sh /proxy-lx.sh -ADD proxy-ls.sh /proxy-ls.sh -ADD proxy-ms.sh /proxy-ms.sh -ADD proxy-ts.sh /proxy-ts.sh +ADD proxy-lgp.sh /proxy-lgp.sh +ADD proxy-lgr.sh /proxy-lgr.sh +ADD proxy-lgt.sh /proxy-lgt.sh -ADD proxy-lsg.sh /proxy-lsg.sh -ADD proxy-lss.sh /proxy-lss.sh -ADD proxy-lsw.sh /proxy-lsw.sh -ADD proxy-msw.sh /proxy-msw.sh -ADD proxy-tsw.sh /proxy-tsw.sh +ADD proxy-lsp.sh /proxy-lsp.sh +ADD proxy-lst.sh /proxy-lst.sh -ADD proxy-lpg.sh /proxy-lpg.sh -ADD proxy-lps.sh /proxy-lps.sh -ADD proxy-lpw.sh /proxy-lpw.sh -ADD proxy-mpw.sh /proxy-mpw.sh -ADD proxy-tpw.sh /proxy-tpw.sh +ADD proxy-ltr.sh /proxy-ltr.sh +ADD proxy-ltt.sh /proxy-ltt.sh + +ADD proxy-lwp.sh /proxy-lwp.sh +ADD proxy-lwt.sh /proxy-lwt.sh + +ADD proxy-mtt.sh /proxy-mtt.sh +ADD proxy-mwp.sh /proxy-mwp.sh +ADD proxy-mwt.sh /proxy-mwt.sh + +ADD proxy-ttt.sh /proxy-ttt.sh +ADD proxy-twp.sh /proxy-twp.sh +ADD proxy-twt.sh /proxy-twt.sh ADD status.sh /status.sh ADD run.sh /run.sh diff --git a/proxy-lpg.sh b/proxy-lgp.sh similarity index 62% rename from proxy-lpg.sh rename to proxy-lgp.sh index dedb4f7..ca03afb 100755 --- a/proxy-lpg.sh +++ b/proxy-lgp.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lpg " + >&2 echo "VLESS-GRPC-PLAIN proxy builder" + >&2 echo "Usage: proxy-lgp " } if [ -z "$1" ]; then @@ -19,7 +20,7 @@ port="${options[1]}" path="${options[2]}" if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -36,20 +37,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ '. += {"network":"grpc", "security":"none", "grpcSettings":{"serviceName":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lgr.sh b/proxy-lgr.sh new file mode 100755 index 0000000..1368f5a --- /dev/null +++ b/proxy-lgr.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +usage() { + >&2 echo "VLESS-GRPC-TLS proxy builder" + >&2 echo "Usage: proxy-lgt [,serverName=x.org][,fingerprint=safari]" +} + +if [ -z "$1" ]; then + >&2 echo "Missing options" + usage + exit 1 +fi + +# id@domain.com:443:/svcpath,serverName=x.org,fingerprint=safari +args=(`echo $1 |tr ',' ' '`) +dest="${args[0]}" +for ext_opt in "${args[@]}" +do + kv=(`echo $ext_opt |tr '=' ' '`) + case "${kv[0]}" in + d|dest) + serverName="${kv[1]}" + ;; + f|fingerprint) + fingerprint="${kv[1]}" + ;; + flow) + flow="${kv[1]}" + ;; + pub|publicKey) + publicKey="${kv[1]}" + ;; + s|serverName) + serverName="${kv[1]}" + ;; + shortId) + shortId="${kv[1]}" + ;; + xtls) + flow="xtls-rprx-vision" + ;; + esac +done +options=(`echo $dest |tr '@' ' '`) +id="${options[0]}" +options=(`echo ${options[1]} |tr ':' ' '`) +host="${options[0]}" +port="${options[1]}" +path="${options[2]}" + +if [ -z "${serverName}" ]; then serverName=${host}; fi +if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi + +if [ -z "${id}" ]; then + >&2 echo "Error: id undefined." + usage + exit 1 +fi + +if [ -z "${host}" ]; then + >&2 echo "Error: destination host undefined." + usage + exit 1 +fi + +if [ -z "${port}" ]; then + port=443 +fi + +if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi + +# User settings +Jusers=`jq -nc --arg uuid "${id}" --arg flow "${flow}" '. += {"id":$uuid, "flow":$flow, "encryption":"none", "level":0}'` + +# Vnest settings +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` + +# Stream Settings +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg publicKey "${publicKey}" --arg shortId "${shortId}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"grpc", "security":"reality","realitySettings":{"publicKey":$publicKey,"serverName":$serverName,"shortId":$shortId,"fingerprint":$fingerprint},"grpcSettings":{"serviceName":$path}}' ` + +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +'. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` +Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' +Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' + +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +'. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` + +echo "$jroot" +exit 0 diff --git a/proxy-lsg.sh b/proxy-lgt.sh similarity index 63% rename from proxy-lsg.sh rename to proxy-lgt.sh index 8bbfeab..ce64684 100755 --- a/proxy-lsg.sh +++ b/proxy-lgt.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lsg [,serverName=x.org][,fingerprint=safari]" + >&2 echo "VLESS-GRPC-TLS proxy builder" + >&2 echo "Usage: proxy-lgt [,serverName=x.org][,fingerprint=safari]" } if [ -z "$1" ]; then @@ -36,7 +37,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -53,20 +54,23 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +# User settings +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +# Vnest settings +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ -'. += {"network":"grpc", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}, "grpcSettings":{"serviceName":$path}}' ` +# Stream Settings +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"grpc", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}, "grpcSettings":{"serviceName":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lps.sh b/proxy-lsp.sh similarity index 62% rename from proxy-lps.sh rename to proxy-lsp.sh index fb75c51..72927a0 100755 --- a/proxy-lps.sh +++ b/proxy-lsp.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lps " + >&2 echo "VLESS-SPLT-PLAIN proxy builder" + >&2 echo "Usage: proxy-lsp " } if [ -z "$1" ]; then @@ -19,7 +20,7 @@ port="${options[1]}" path="${options[2]}" if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -36,20 +37,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ '. += {"network":"splithttp", "security":"none", "splithttpSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lss.sh b/proxy-lst.sh similarity index 67% rename from proxy-lss.sh rename to proxy-lst.sh index a0461de..50d8d76 100755 --- a/proxy-lss.sh +++ b/proxy-lst.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lss [,serverName=x.org][,fingerprint=safari]" + >&2 echo "VLESS-SPLT-TLS proxy builder" + >&2 echo "Usage: proxy-lst [,serverName=x.org][,fingerprint=safari]" } if [ -z "$1" ]; then @@ -36,7 +37,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -53,20 +54,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ -'. += {"network":"splithttp", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}, "splithttpSettings":{"path":$path}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"splithttp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}, "splithttpSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-ls.sh b/proxy-ltr.sh similarity index 52% rename from proxy-ls.sh rename to proxy-ltr.sh index 2efa0a9..63815b5 100755 --- a/proxy-ls.sh +++ b/proxy-ltr.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-ls [,serverName=x.org][,fingerprint=safari]" + >&2 echo "VLESS-TCP-REALITY proxy builder" + >&2 echo "Usage: proxy-ltr ,,pub=xxxx[,shortId=abcd][,xtls][,fingerprint=safari]" } if [ -z "$1" ]; then @@ -17,12 +18,27 @@ for ext_opt in "${args[@]}" do kv=(`echo $ext_opt |tr '=' ' '`) case "${kv[0]}" in - s|serverName) + d|dest) serverName="${kv[1]}" ;; f|fingerprint) fingerprint="${kv[1]}" ;; + flow) + flow="${kv[1]}" + ;; + pub|publicKey) + publicKey="${kv[1]}" + ;; + s|serverName) + serverName="${kv[1]}" + ;; + shortId) + shortId="${kv[1]}" + ;; + xtls) + flow="xtls-rprx-vision" + ;; esac done options=(`echo $dest |tr '@' ' '`) @@ -35,7 +51,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -52,20 +68,23 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +# User settings +Jusers=`jq -nc --arg uuid "${id}" --arg flow "${flow}" '. += {"id":$uuid, "flow":$flow, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +# Vnest settings +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ -'. += {"network":"tcp", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}}' ` +# Stream Settings +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg publicKey "${publicKey}" --arg shortId "${shortId}" --arg fingerprint "${fingerprint}" \ +'. += {"network":"tcp", "security":"reality", "realitySettings":{"publicKey":$publicKey,"serverName":$serverName,"shortId":$shortId,"fingerprint":$fingerprint}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lx.sh b/proxy-ltt.sh similarity index 60% rename from proxy-lx.sh rename to proxy-ltt.sh index a4fe041..420f3cc 100755 --- a/proxy-lx.sh +++ b/proxy-ltt.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lx [,serverName=x.org][,fingerprint=safari]" + >&2 echo "VLESS-TCP-TLS proxy builder" + >&2 echo "Usage: proxy-ltt [,xtls][,serverName=x.org][,fingerprint=safari]" } if [ -z "$1" ]; then @@ -23,6 +24,9 @@ do f|fingerprint) fingerprint="${kv[1]}" ;; + xtls) + flow="xtls-rprx-vision" + ;; esac done options=(`echo $dest |tr '@' ' '`) @@ -35,7 +39,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -52,20 +56,23 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "flow":"xtls-rprx-vision", "encryption":"none", "level":0}'` +# User settings +Jusers=`jq -nc --arg uuid "${id}" --arg flow "${flow}" '. += {"id":$uuid, "flow":$flow, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +# Vnest settings +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ -'. += {"network":"tcp", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}}' ` +# Stream Settings +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ +'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lpw.sh b/proxy-lwp.sh similarity index 62% rename from proxy-lpw.sh rename to proxy-lwp.sh index 51341bb..7fd9392 100755 --- a/proxy-lpw.sh +++ b/proxy-lwp.sh @@ -1,7 +1,8 @@ #!/bin/bash usage() { - >&2 echo "Usage: proxy-lpw " + >&2 echo "VLESS-WS-PLAIN proxy builder" + >&2 echo "Usage: proxy-lwp " } if [ -z "$1" ]; then @@ -19,7 +20,7 @@ port="${options[1]}" path="${options[2]}" if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -36,20 +37,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ '. += {"network":"ws", "security":"none", "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-lsw.sh b/proxy-lwt.sh similarity index 67% rename from proxy-lsw.sh rename to proxy-lwt.sh index ff77128..1728381 100755 --- a/proxy-lsw.sh +++ b/proxy-lwt.sh @@ -1,6 +1,7 @@ #!/bin/bash usage() { + >&2 echo "VLESS-WS-TLS proxy builder" >&2 echo "Usage: proxy-lsw [,serverName=x.org][,fingerprint=safari]" } @@ -36,7 +37,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -53,20 +54,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ -'. += {"network":"ws", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-ms.sh b/proxy-mtt.sh similarity index 68% rename from proxy-ms.sh rename to proxy-mtt.sh index b081f3a..dd637cd 100755 --- a/proxy-ms.sh +++ b/proxy-mtt.sh @@ -1,6 +1,7 @@ #!/bin/bash usage() { + >&2 echo "VMESS-TCP-TLS proxy builder" >&2 echo "Usage: proxy-ms [,serverName=x.org][,fingerprint=safari]" } @@ -35,7 +36,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -52,20 +53,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ -'. += {"network":"tcp", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ +'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-mpw.sh b/proxy-mwp.sh similarity index 68% rename from proxy-mpw.sh rename to proxy-mwp.sh index 55d51f0..09ca28b 100755 --- a/proxy-mpw.sh +++ b/proxy-mwp.sh @@ -1,6 +1,7 @@ #!/bin/bash usage() { + >&2 echo "VMESS-WS-PLAIN proxy builder" >&2 echo "Usage: proxy-mpw " } @@ -22,7 +23,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -39,20 +40,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ '. += {"network":"ws", "security":"none", "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-msw.sh b/proxy-mwt.sh similarity index 67% rename from proxy-msw.sh rename to proxy-mwt.sh index 4cf7b1e..85db942 100755 --- a/proxy-msw.sh +++ b/proxy-mwt.sh @@ -1,6 +1,7 @@ #!/bin/bash usage() { + >&2 echo "VMESS-WS-TLS proxy builder" >&2 echo "Usage: proxy-msw [,serverName=x.org][,fingerprint=safari]" } @@ -36,7 +37,7 @@ if [ -z "${serverName}" ]; then serverName=${host}; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${id}" ]; then - >&2 echo "Error: uuid undefined." + >&2 echo "Error: id undefined." usage exit 1 fi @@ -53,20 +54,20 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` +Jusers=`jq -nc --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'` -Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ +Jvnext=`jq -nc --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \ '. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ -'. += {"network":"ws", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-ts.sh b/proxy-ttt.sh similarity index 73% rename from proxy-ts.sh rename to proxy-ttt.sh index ea08e70..07dbdd3 100755 --- a/proxy-ts.sh +++ b/proxy-ttt.sh @@ -53,18 +53,18 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ +Jservers=`jq -nc --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ '. += {"address":$host, "port":($port | tonumber), "password":$passwd}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ -'. += {"network":"tcp", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \ +'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-tpw.sh b/proxy-twp.sh similarity index 74% rename from proxy-tpw.sh rename to proxy-twp.sh index 1bc20b2..4ef40ca 100755 --- a/proxy-tpw.sh +++ b/proxy-twp.sh @@ -40,18 +40,18 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ +Jservers=`jq -nc --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ '. += {"address":$host, "port":($port | tonumber), "password":$passwd}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ '. += {"network":"ws", "security":"none", "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/proxy-tsw.sh b/proxy-twt.sh similarity index 72% rename from proxy-tsw.sh rename to proxy-twt.sh index 4380027..ff609f2 100755 --- a/proxy-tsw.sh +++ b/proxy-twt.sh @@ -54,18 +54,18 @@ fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi -Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ +Jservers=`jq -nc --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \ '. += {"address":$host, "port":($port | tonumber), "password":$passwd}' ` -JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ -'. += {"network":"ws", "security":"tls", "tlsSettings":{"alpn":["h2,http/1.1"], "serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` +JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ +'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}, "wsSettings":{"path":$path}}' ` -Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ +Jproxy=`jq -nc --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \ '. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' ` Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' -jroot=`echo '{}' | jq --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ +jroot=`jq -n --argjson jproxy "${Jproxy}" --argjson jdirect "${Jdirect}" --argjson jblocked "${Jblocked}" \ '. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' ` echo "$jroot" diff --git a/run.sh b/run.sh index 9b51fa8..4ef6ebb 100755 --- a/run.sh +++ b/run.sh @@ -6,20 +6,21 @@ XCONF=/tmp/proxy-xray.json usage() { echo "proxy-xray " - echo " --lx id@host:port[,s=sniname.org]" - echo " --ls id@host:port[,s=sniname.org]" - echo " --ms id@host:port[,s=sniname.org]" - echo " --ts password@host:port[,s=sniname.org]" - echo " --lsg id@host:port:svcname[,s=sniname.org]" - echo " --lss id@host:port:/webpath[,s=sniname.org]" - echo " --lsw id@host:port:/wspath[,s=sniname.org]" - echo " --msw id@host:port:/wspath[,s=sniname.org]" - echo " --tsw password@host:port:/wspath[,s=sniname.org]" - echo " --lpg id@host:port:svcname" - echo " --lps id@host:port:/webpath" - echo " --lpw id@host:port:/wspath" - echo " --mpw id@host:port:/wspath" - echo " --tpw password@host:port:/wspath" + echo " --lgp id@host:port:svcname" + echo " --lgr id@host:port:svcname,d=dest.com,pub=xxxx[,shortId=abcd]" + echo " --lgt id@host:port:svcname[,s=sni.com]" + echo " --lsp id@host:port:/webpath" + echo " --lst id@host:port:/webpath[,s=sni.com]" + echo " --ltr id@host:port,d=dest.com,pub=xxxx[,shortId=abcd][,xtls]" + echo " --ltt id@host:port[,s=sni.com][,xtls]" + echo " --lwp id@host:port:/wspath" + echo " --lwt id@host:port:/wspath[,s=sni.com]" + echo " --mtt id@host:port[,s=sni.com]" + echo " --mwp id@host:port:/wspath" + echo " --mwt id@host:port:/wspath[,s=sni.com]" + echo " --ttt password@host:port[,s=sni.com]" + echo " --twp password@host:port:/wspath" + echo " --twt password@host:port:/wspath[,s=sni.com]" echo " -d|--debug Start in debug mode with verbose output" echo " -i|--stdin Read config from stdin instead of auto generation" echo " -j|--json '{"log":{"loglevel":"info"}' Json snippet to merge into the config" @@ -39,12 +40,12 @@ usage() { Jrules='{"rules":[]}' -TEMP=`getopt -o j:di --long json:lx:,ls:,ms:,ts:,lsg:,lss:,lsw:,msw:,tsw:,lpg:,lps:,lpw:,mpw:,tpw:,stdin,debug,dns:,dns-local:,dns-local-cn,domain-direct:,domain-proxy:,domain-block:,ip-direct:,ip-proxy:,ip-block:,cn-direct,rules-path: -n "$0" -- $@` +TEMP=`getopt -o j:di --long lgp:,lgr:,lgt:,lsp:,lst:,ltr:,ltt:,lwp:,lwt:,mtt:,mwp:,mwt:,ttt:,twp:,twt:,stdin,debug,dns:,dns-local:,dns-local-cn,domain-direct:,domain-proxy:,domain-block:,ip-direct:,ip-proxy:,ip-block:,cn-direct,rules-path:json: -n "$0" -- $@` if [ $? != 0 ] ; then usage; exit 1 ; fi eval set -- "$TEMP" while true ; do case "$1" in - --lx|--ls|--ms|--ts|--lsg|--lss|--lsw|--msw|--tsw|--lpg|--lps|--lpw|--mpw|--tpw) + --lgp|--lgr|--lgt|--lsp|--lst|--ltr|--ltt|--lwp|--lwt|--mtt|--mwp|--mwt|--ttt|--twp|--twt) subcmd=`echo "$1"|tr -d "\-\-"` $DIR/proxy-${subcmd}.sh $2 >$XCONF if [ $? != 0 ]; then