mirror of
https://github.com/samuelhbne/proxy-xray.git
synced 2025-12-16 20:27:06 +03:00
Initial REALITY support
This commit is contained in:
36
Dockerfile
36
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
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lpg <id@domain.com:80:/svcpath>"
|
||||
>&2 echo "VLESS-GRPC-PLAIN proxy builder"
|
||||
>&2 echo "Usage: proxy-lgp <id@domain.com:80:/svcpath>"
|
||||
}
|
||||
|
||||
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"
|
||||
92
proxy-lgr.sh
Executable file
92
proxy-lgr.sh
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "VLESS-GRPC-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-lgt <id@domain.com:443:/svcpath>[,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
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lsg <id@domain.com:443:/svcpath>[,serverName=x.org][,fingerprint=safari]"
|
||||
>&2 echo "VLESS-GRPC-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-lgt <id@domain.com:443:/svcpath>[,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"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lps <id@domain.com:80:/webpath>"
|
||||
>&2 echo "VLESS-SPLT-PLAIN proxy builder"
|
||||
>&2 echo "Usage: proxy-lsp <id@domain.com:80:/webpath>"
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lss <id@domain.com:443:/webpath>[,serverName=x.org][,fingerprint=safari]"
|
||||
>&2 echo "VLESS-SPLT-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-lst <id@domain.com:443:/webpath>[,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"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-ls <id@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||
>&2 echo "VLESS-TCP-REALITY proxy builder"
|
||||
>&2 echo "Usage: proxy-ltr <id@domain.com:443>,<d=yahoo.com>,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"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lx <id@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||
>&2 echo "VLESS-TCP-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-ltt <id@domain.com:443>[,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"
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-lpw <id@domain.com:80:/websocket>"
|
||||
>&2 echo "VLESS-WS-PLAIN proxy builder"
|
||||
>&2 echo "Usage: proxy-lwp <id@domain.com:80:/websocket>"
|
||||
}
|
||||
|
||||
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"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "VLESS-WS-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-lsw <id@domain.com:443:/websocket>[,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"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "VMESS-TCP-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-ms <id@domain.com:443>[,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"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "VMESS-WS-PLAIN proxy builder"
|
||||
>&2 echo "Usage: proxy-mpw <id@domain.com:443:/websocket>"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "VMESS-WS-TLS proxy builder"
|
||||
>&2 echo "Usage: proxy-msw <id@domain.com:443:/websocket>[,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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
33
run.sh
33
run.sh
@@ -6,20 +6,21 @@ XCONF=/tmp/proxy-xray.json
|
||||
|
||||
usage() {
|
||||
echo "proxy-xray <connection-options>"
|
||||
echo " --lx <VLESS-XTLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --ls <VLESS-TLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --ms <VMESS-TLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --ts <TROJAN-TLS option> password@host:port[,s=sniname.org]"
|
||||
echo " --lsg <VLESS-TLS-GRPC option> id@host:port:svcname[,s=sniname.org]"
|
||||
echo " --lss <VLESS-TLS-SPLT option> id@host:port:/webpath[,s=sniname.org]"
|
||||
echo " --lsw <VLESS-TLS-WS option> id@host:port:/wspath[,s=sniname.org]"
|
||||
echo " --msw <VMESS-TLS-WS option> id@host:port:/wspath[,s=sniname.org]"
|
||||
echo " --tsw <TROJAN-TLS-WS option> password@host:port:/wspath[,s=sniname.org]"
|
||||
echo " --lpg <VLESS-PLN-GRPC option> id@host:port:svcname"
|
||||
echo " --lps <VLESS-PLN-SPLT option> id@host:port:/webpath"
|
||||
echo " --lpw <VLESS-PLN-WS option> id@host:port:/wspath"
|
||||
echo " --mpw <VMESS-PLN-WS option> id@host:port:/wspath"
|
||||
echo " --tpw <TROJAN-PLN-WS option> password@host:port:/wspath"
|
||||
echo " --lgp <VLESS-GRPC-PLN option> id@host:port:svcname"
|
||||
echo " --lgr <VLESS-GRPC-RLTY option> id@host:port:svcname,d=dest.com,pub=xxxx[,shortId=abcd]"
|
||||
echo " --lgt <VLESS-GRPC-TLS option> id@host:port:svcname[,s=sni.com]"
|
||||
echo " --lsp <VLESS-SPLT-PLN option> id@host:port:/webpath"
|
||||
echo " --lst <VLESS-SPLT-TLS option> id@host:port:/webpath[,s=sni.com]"
|
||||
echo " --ltr <VLESS-TCP-RLTY option> id@host:port,d=dest.com,pub=xxxx[,shortId=abcd][,xtls]"
|
||||
echo " --ltt <VLESS-TCP-TLS option> id@host:port[,s=sni.com][,xtls]"
|
||||
echo " --lwp <VLESS-WS-PLN option> id@host:port:/wspath"
|
||||
echo " --lwt <VLESS-WS-TLS option> id@host:port:/wspath[,s=sni.com]"
|
||||
echo " --mtt <VMESS-TCP-TLS option> id@host:port[,s=sni.com]"
|
||||
echo " --mwp <VMESS-WS-PLN option> id@host:port:/wspath"
|
||||
echo " --mwt <VMESS-WS-TLS option> id@host:port:/wspath[,s=sni.com]"
|
||||
echo " --ttt <TROJAN-TCP-TLS option> password@host:port[,s=sni.com]"
|
||||
echo " --twp <TROJAN-WS-PLN option> password@host:port:/wspath"
|
||||
echo " --twt <TROJAN-WS-TLS option> 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
|
||||
|
||||
Reference in New Issue
Block a user