mirror of
https://github.com/samuelhbne/proxy-xray.git
synced 2025-12-18 05:04:37 +03:00
Add --ltpg --ltpw --mtpw --ttpw support
This commit is contained in:
@@ -40,11 +40,15 @@ RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.c
|
||||
|
||||
ADD proxy-ltx.sh /proxy-ltx.sh
|
||||
ADD proxy-ltt.sh /proxy-ltt.sh
|
||||
ADD proxy-ltpw.sh /proxy-ltpw.sh
|
||||
ADD proxy-lttw.sh /proxy-lttw.sh
|
||||
ADD proxy-ltpg.sh /proxy-ltpg.sh
|
||||
ADD proxy-lttg.sh /proxy-lttg.sh
|
||||
ADD proxy-mtt.sh /proxy-mtt.sh
|
||||
ADD proxy-mtpw.sh /proxy-mtpw.sh
|
||||
ADD proxy-mttw.sh /proxy-mttw.sh
|
||||
ADD proxy-ttt.sh /proxy-ttt.sh
|
||||
ADD proxy-ttpw.sh /proxy-ttpw.sh
|
||||
ADD proxy-tttw.sh /proxy-tttw.sh
|
||||
ADD status.sh /status.sh
|
||||
ADD run.sh /run.sh
|
||||
|
||||
@@ -40,11 +40,15 @@ RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.c
|
||||
|
||||
ADD proxy-ltx.sh /proxy-ltx.sh
|
||||
ADD proxy-ltt.sh /proxy-ltt.sh
|
||||
ADD proxy-ltpw.sh /proxy-ltpw.sh
|
||||
ADD proxy-lttw.sh /proxy-lttw.sh
|
||||
ADD proxy-ltpg.sh /proxy-ltpg.sh
|
||||
ADD proxy-lttg.sh /proxy-lttg.sh
|
||||
ADD proxy-mtt.sh /proxy-mtt.sh
|
||||
ADD proxy-mtpw.sh /proxy-mtpw.sh
|
||||
ADD proxy-mttw.sh /proxy-mttw.sh
|
||||
ADD proxy-ttt.sh /proxy-ttt.sh
|
||||
ADD proxy-ttpw.sh /proxy-ttpw.sh
|
||||
ADD proxy-tttw.sh /proxy-tttw.sh
|
||||
ADD status.sh /status.sh
|
||||
ADD run.sh /run.sh
|
||||
|
||||
@@ -40,11 +40,15 @@ RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.c
|
||||
|
||||
ADD proxy-ltx.sh /proxy-ltx.sh
|
||||
ADD proxy-ltt.sh /proxy-ltt.sh
|
||||
ADD proxy-ltpw.sh /proxy-ltpw.sh
|
||||
ADD proxy-lttw.sh /proxy-lttw.sh
|
||||
ADD proxy-ltpg.sh /proxy-ltpg.sh
|
||||
ADD proxy-lttg.sh /proxy-lttg.sh
|
||||
ADD proxy-mtt.sh /proxy-mtt.sh
|
||||
ADD proxy-mtpw.sh /proxy-mtpw.sh
|
||||
ADD proxy-mttw.sh /proxy-mttw.sh
|
||||
ADD proxy-ttt.sh /proxy-ttt.sh
|
||||
ADD proxy-ttpw.sh /proxy-ttpw.sh
|
||||
ADD proxy-tttw.sh /proxy-tttw.sh
|
||||
ADD status.sh /status.sh
|
||||
ADD run.sh /run.sh
|
||||
|
||||
@@ -77,11 +77,15 @@ $ docker run --rm samuelhbne/proxy-xray
|
||||
proxy-xray <connection-options>
|
||||
--ltx <VLESS-TCP-XTLS option> id@host:port[,s=sniname.org]
|
||||
--ltt <VLESS-TCP-TLS option> id@host:port[,s=sniname.org]
|
||||
--ltpw <VLESS-TCP-PLAIN-WS option> id@host:port:/webpath
|
||||
--lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]
|
||||
--ltpg <VLESS-TCP-PLAIN-GRPC option> id@host:port:svcname
|
||||
--lttg <VLESS-TCP-TLS-GRPC option> id@host:port:svcname[,s=sniname.org]
|
||||
--mtt <VMESS-TCP-TLS option> id@host:port[,s=sniname.org]
|
||||
--mtpw <VMESS-TCP-PLAIN-WS option> id@host:port:/webpath
|
||||
--mttw <VMESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]
|
||||
--ttt <TROJAN-TCP-TLS option> password@host:port[,s=sniname.org]
|
||||
--ttpw <TROJAN-TCP-PLAIN-WS option> password@host:port:/webpath
|
||||
--tttw <TROJAN-TCP-TLS-WS option> password@host:port:/webpath[,s=sniname.org]
|
||||
-d|--debug [Optional] Start in debug mode with verbose output
|
||||
-i|--stdin [Optional] Read config from stdin instead of auto generation
|
||||
|
||||
56
proxy-ltpg.sh
Executable file
56
proxy-ltpg.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-ltpg <id@domain.com:80:/svcpath>"
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
>&2 echo "Missing options"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# id@domain.com:80:/svcpath
|
||||
options=(`echo $1 |tr '@' ' '`)
|
||||
id="${options[0]}"
|
||||
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||
host="${options[0]}"
|
||||
port="${options[1]}"
|
||||
path="${options[2]}"
|
||||
|
||||
if [ -z "${id}" ]; then
|
||||
>&2 echo "Error: uuid undefined."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${host}" ]; then
|
||||
>&2 echo "Error: destination host undefined."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=80
|
||||
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}'`
|
||||
|
||||
Jvnext=`echo '{}' | jq --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":"none", "grpcSettings":{"serviceName":$path}}' `
|
||||
|
||||
Jproxy=`echo '{}' | jq --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}" \
|
||||
'. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' `
|
||||
|
||||
echo "$jroot"
|
||||
exit 0
|
||||
56
proxy-ltpw.sh
Executable file
56
proxy-ltpw.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-ltpw <id@domain.com:80:/websocket>"
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
>&2 echo "Missing options"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# id@domain.com:443:/websocket
|
||||
options=(`echo $1 |tr '@' ' '`)
|
||||
id="${options[0]}"
|
||||
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||
host="${options[0]}"
|
||||
port="${options[1]}"
|
||||
path="${options[2]}"
|
||||
|
||||
if [ -z "${id}" ]; then
|
||||
>&2 echo "Error: uuid undefined."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${host}" ]; then
|
||||
>&2 echo "Error: destination host undefined."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=80
|
||||
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}'`
|
||||
|
||||
Jvnext=`echo '{}' | jq --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":"none", "wsSettings":{"path":$path}}' `
|
||||
|
||||
Jproxy=`echo '{}' | jq --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}" \
|
||||
'. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' `
|
||||
|
||||
echo "$jroot"
|
||||
exit 0
|
||||
59
proxy-mtpw.sh
Executable file
59
proxy-mtpw.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-mtpw <id@domain.com:443:/websocket>"
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
>&2 echo "Missing options"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# id@domain.com:443:/websocket
|
||||
options=(`echo $1 |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: uuid 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
|
||||
|
||||
Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none", "level":0}'`
|
||||
|
||||
Jvnext=`echo '{}' | jq --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":"none", "wsSettings":{"path":$path}}' `
|
||||
|
||||
Jproxy=`echo '{}' | jq --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}" \
|
||||
'. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' `
|
||||
|
||||
echo "$jroot"
|
||||
exit 0
|
||||
58
proxy-ttpw.sh
Executable file
58
proxy-ttpw.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage() {
|
||||
>&2 echo "Usage: proxy-ttpw <password@domain.com:443:/websocket>"
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
>&2 echo "Missing options"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# password@domain.com:443:/websocket
|
||||
options=(`echo $1 |tr '@' ' '`)
|
||||
id="${options[0]}"
|
||||
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||
host="${options[0]}"
|
||||
port="${options[1]}"
|
||||
path="${options[2]}"
|
||||
passwd="${id}"
|
||||
|
||||
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||
|
||||
if [ -z "${passwd}" ]; then
|
||||
>&2 echo "Error: password 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
|
||||
|
||||
Jservers=`echo '{}' | jq --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":"none", "wsSettings":{"path":$path}}' `
|
||||
|
||||
Jproxy=`echo '{}' | jq --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}" \
|
||||
'. += {"log":{"loglevel":"warning"}, "outbounds":[$jproxy, $jdirect, $jblocked]}' `
|
||||
|
||||
echo "$jroot"
|
||||
exit 0
|
||||
8
run.sh
8
run.sh
@@ -8,11 +8,15 @@ usage() {
|
||||
echo "proxy-xray <connection-options>"
|
||||
echo " --ltx <VLESS-TCP-XTLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --ltt <VLESS-TCP-TLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --ltpw <VLESS-TCP-PLAIN-WS option> id@host:port:/webpath"
|
||||
echo " --lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]"
|
||||
echo " --ltpg <VLESS-TCP-PLAIN-GRPC option> id@host:port:svcname"
|
||||
echo " --lttg <VLESS-TCP-TLS-GRPC option> id@host:port:svcname[,s=sniname.org]"
|
||||
echo " --mtt <VMESS-TCP-TLS option> id@host:port[,s=sniname.org]"
|
||||
echo " --mtpw <VMESS-TCP-PLAIN-WS option> id@host:port:/webpath"
|
||||
echo " --mttw <VMESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]"
|
||||
echo " --ttt <TROJAN-TCP-TLS option> password@host:port[,s=sniname.org]"
|
||||
echo " --ttpw <TROJAN-TCP-PLAIN-WS option> password@host:port:/webpath"
|
||||
echo " --tttw <TROJAN-TCP-TLS-WS option> password@host:port:/webpath[,s=sniname.org]"
|
||||
# echo " --ssa <Shadowsocks-AEAD option> password:method@host:port"
|
||||
# echo " --sst <Shadowsocks-TCP option> password:method@host:port"
|
||||
@@ -34,12 +38,12 @@ usage() {
|
||||
|
||||
Jrules='{"rules":[]}'
|
||||
|
||||
TEMP=`getopt -o di --long ltx:,ltt:,lttw:,lttg:,mtt:,mttw:,ttt:,tttw:,ssa:,sst:,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 di --long ltx:,ltt:,ltpw:,lttw:,ltpg:,lttg:,mtt:,mtpw:,mttw:,ttt:,ttpw:,tttw:,ssa:,sst:,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" -- $@`
|
||||
if [ $? != 0 ] ; then usage; exit 1 ; fi
|
||||
eval set -- "$TEMP"
|
||||
while true ; do
|
||||
case "$1" in
|
||||
--ltx|--ltt|--lttw|--lttg|--mtt|--mttw|--ttt|--tttw|--ssa|--sst)
|
||||
--ltx|--ltt|--ltpw|--lttw|--ltpg|--lttg|--mtt|--mtpw|--mttw|--ttt|--ttpw|--tttw|--ssa|--sst)
|
||||
subcmd=`echo "$1"|tr -d "\-\-"`
|
||||
$DIR/proxy-${subcmd}.sh $2 >$XCONF
|
||||
if [ $? != 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user