Remove s=sni.com from doc as it needs allowInscure

This commit is contained in:
Samuel Huang
2024-09-21 22:53:06 +10:00
parent 4e39e59d1f
commit 13dbbc547f

View File

@@ -2,7 +2,7 @@
usage() { usage() {
>&2 echo "VLESS-GRPC-TLS proxy builder" >&2 echo "VLESS-GRPC-TLS proxy builder"
>&2 echo "Usage: proxy-lgt <id@domain.com:443:/svcpath>[,serverName=x.org][,fingerprint=safari]" >&2 echo "Usage: proxy-lgr <id@domain.com:443:/svcpath><d=yahoo.com>,pub=xxxx[,shortId=abcd][,fingerprint=safari]"
} }
if [ -z "$1" ]; then if [ -z "$1" ]; then
@@ -11,7 +11,7 @@ if [ -z "$1" ]; then
exit 1 exit 1
fi fi
# id@domain.com:443:/svcpath,serverName=x.org,fingerprint=safari # id@domain.com:443:/svcpath,dest=yahoo.com,pub=xxxx,fingerprint=safari
args=(`echo $1 |tr ',' ' '`) args=(`echo $1 |tr ',' ' '`)
dest="${args[0]}" dest="${args[0]}"
for ext_opt in "${args[@]}" for ext_opt in "${args[@]}"
@@ -21,6 +21,9 @@ do
d|dest) d|dest)
serverName="${kv[1]}" serverName="${kv[1]}"
;; ;;
s|serverName)
serverName="${kv[1]}"
;;
f|fingerprint) f|fingerprint)
fingerprint="${kv[1]}" fingerprint="${kv[1]}"
;; ;;
@@ -30,9 +33,6 @@ do
pub|publicKey) pub|publicKey)
publicKey="${kv[1]}" publicKey="${kv[1]}"
;; ;;
s|serverName)
serverName="${kv[1]}"
;;
shortId) shortId)
shortId="${kv[1]}" shortId="${kv[1]}"
;; ;;
@@ -48,7 +48,6 @@ host="${options[0]}"
port="${options[1]}" port="${options[1]}"
path="${options[2]}" path="${options[2]}"
if [ -z "${serverName}" ]; then serverName=${host}; fi
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
if [ -z "${id}" ]; then if [ -z "${id}" ]; then
@@ -76,23 +75,23 @@ fi
if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be numeric"; exit 1; fi
# User settings # User settings
Jusers=`jq -nc --arg uuid "${id}" --arg flow "${flow}" '. += {"id":$uuid, "flow":$flow, "encryption":"none", "level":0}'` Jusers=`jq -nc --arg uuid "${id}" --arg flow "${flow}" '. += {"flow":$flow,"id":$uuid,"encryption":"none","level":0}'`
# Vnest settings # Vnext settings
Jvnext=`jq -nc --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]}' ` '. += {"address":$host,"port":($port | tonumber),"users":[$juser]}' `
# Stream Settings # Stream Settings
JstreamSettings=`jq -nc --arg serverName "${serverName}" --arg publicKey "${publicKey}" --arg shortId "${shortId}" --arg fingerprint "${fingerprint}" --arg path "${path}" \ 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}}' ` '. += {"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}" \ Jproxy=`jq -nc --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
'. += { "tag": "proxy", "protocol":"vless", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' ` '. += { "tag":"proxy","protocol":"vless","settings":{"vnext":[$jvnext]},"streamSettings":$jstreamSettings}' `
Jdirect='{"tag": "direct", "protocol": "freedom", "settings": {}}' Jdirect='{"tag":"direct","protocol":"freedom","settings":{}}'
Jblocked='{"tag": "blocked", "protocol": "blackhole", "settings": {}}' Jblocked='{"tag":"blocked","protocol":"blackhole","settings":{}}'
jroot=`jq -n --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]}' ` '. += {"log":{"loglevel":"warning"},"outbounds":[$jproxy,$jdirect,$jblocked]}' `
echo "$jroot" echo "$jroot"
exit 0 exit 0