mirror of
https://github.com/samuelhbne/proxy-xray.git
synced 2025-12-17 12:44:38 +03:00
sni support
This commit is contained in:
16
README.md
16
README.md
@@ -30,14 +30,14 @@ Please replace "amd64" with the arch match the current box accordingly. Other su
|
|||||||
```shell
|
```shell
|
||||||
$ docker run --rm samuelhbne/proxy-xray
|
$ docker run --rm samuelhbne/proxy-xray
|
||||||
proxy-xray <connection-options>
|
proxy-xray <connection-options>
|
||||||
--ltx <VLESS-TCP-XTLS option> id@host:port
|
--ltx <VLESS-TCP-XTLS option> id@host:port[,s=sniname.org]
|
||||||
--ltt <VLESS-TCP-TLS option> id@host:port
|
--ltt <VLESS-TCP-TLS option> id@host:port[,s=sniname.org]
|
||||||
--lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath
|
--lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]
|
||||||
--lttg <VLESS-TCP-TLS-GRPC option> id@host:port:/svcpath
|
--lttg <VLESS-TCP-TLS-GRPC option> id@host:port:/svcpath[,s=sniname.org]
|
||||||
--mtt <VMESS-TCP-TLS option> id@host:port
|
--mtt <VMESS-TCP-TLS option> id@host:port[,s=sniname.org]
|
||||||
--mttw <VMESS-TCP-TLS-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
|
--ttt <TROJAN-TCP-TLS option> password@host:port[,s=sniname.org]
|
||||||
--tttw <TROJAN-TCP-TLS-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
|
-d|--debug [Optional] Start in debug mode with verbose output
|
||||||
-i|--stdin [Optional] Read config from stdin instead of auto generation
|
-i|--stdin [Optional] Read config from stdin instead of auto generation
|
||||||
--dns <upstream-DNS-ip> [Optional] Designated upstream DNS server IP, 1.1.1.1 will be applied by default
|
--dns <upstream-DNS-ip> [Optional] Designated upstream DNS server IP, 1.1.1.1 will be applied by default
|
||||||
|
|||||||
31
proxy-ltt.sh
31
proxy-ltt.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-ltt <uuid@domain0.com:443>"
|
>&2 echo "Usage: proxy-ltt <id@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,15 +10,30 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uuid@domain0.com:443
|
# id@domain.com:443,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
host="${options[0]}"
|
||||||
port="${options[1]}"
|
port="${options[1]}"
|
||||||
|
|
||||||
|
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||||
|
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||||
|
|
||||||
if [ -z "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
usage
|
usage
|
||||||
@@ -42,8 +57,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none",
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \
|
||||||
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$host}}' `
|
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' `
|
||||||
|
|
||||||
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
|
Jproxy=`echo '{}' | jq --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 }' `
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-lttg <uuid@domain0.com:443:/svcpath>"
|
>&2 echo "Usage: proxy-lttg <id@domain.com:443:/svcpath>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,16 +10,31 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uuid@domain0.com:443:/svcpath
|
# id@domain.com:443:/svcpath,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
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 "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
usage
|
usage
|
||||||
@@ -43,8 +58,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none",
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" --arg path "${path}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \
|
||||||
'. += {"network":"grpc", "security":"tls", "tlsSettings":{"serverName":$host}, "grpcSettings":{"serviceName":$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=`echo '{}' | jq --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 }' `
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-lttw <uuid@domain0.com:443:/websocket>"
|
>&2 echo "Usage: proxy-lttw <id@domain.com:443:/websocket>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,16 +10,31 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uuid@domain0.com:443:/websocket
|
# id@domain.com:443:/websocket,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
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 "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
usage
|
usage
|
||||||
@@ -43,8 +58,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none",
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" --arg path "${path}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \
|
||||||
'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$host}, "wsSettings":{"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=`echo '{}' | jq --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 }' `
|
||||||
|
|||||||
31
proxy-ltx.sh
31
proxy-ltx.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-ltx <uuid@domain0.com:443>"
|
>&2 echo "Usage: proxy-ltx <id@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,15 +10,30 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uuid@domain0.com:443
|
# id@domain.com:443,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
host="${options[0]}"
|
||||||
port="${options[1]}"
|
port="${options[1]}"
|
||||||
|
|
||||||
|
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||||
|
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||||
|
|
||||||
if [ -z "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
usage
|
usage
|
||||||
@@ -42,8 +57,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "flow":"xtls-rprx-di
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \
|
||||||
'. += {"network":"tcp", "security":"xtls", "xtlsSettings":{"serverName":$host}}' `
|
'. += {"network":"tcp", "security":"xtls", "xtlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' `
|
||||||
|
|
||||||
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
|
Jproxy=`echo '{}' | jq --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 }' `
|
||||||
|
|||||||
38
proxy-mtt.sh
38
proxy-mtt.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-mtt <uuid@domain0.com:443>"
|
>&2 echo "Usage: proxy-mtt <id@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,21 +10,29 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# password:method@domain0.com:443/websocket
|
# id@domain.com:443,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr '/' ' '`)
|
|
||||||
path="${options[1]}"
|
|
||||||
temp="${options[0]}"
|
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
host="${options[0]}"
|
||||||
port="${options[1]}"
|
port="${options[1]}"
|
||||||
temp=$id
|
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||||
passwd="${options[0]}"
|
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||||
method="${options[2]}"
|
|
||||||
|
|
||||||
if [ -z "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
@@ -49,8 +57,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none",
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \
|
||||||
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$host}}' `
|
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' `
|
||||||
|
|
||||||
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
|
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
|
||||||
'. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' `
|
'. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' `
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-mttw <uuid@domain0.com:443:/websocket>"
|
>&2 echo "Usage: proxy-mttw <id@domain.com:443:/websocket>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,16 +10,31 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# uuid@domain0.com:443:/websocket
|
# id@domain.com:443:/websocket,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
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 "${id}" ]; then
|
if [ -z "${id}" ]; then
|
||||||
>&2 echo "Error: uuid undefined."
|
>&2 echo "Error: uuid undefined."
|
||||||
usage
|
usage
|
||||||
@@ -43,8 +58,8 @@ Jusers=`echo '{}' |jq --arg uuid "${id}" '. += {"id":$uuid, "encryption":"none",
|
|||||||
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
Jvnext=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --argjson juser "${Jusers}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
'. += {"address":$host, "port":($port | tonumber), "users":[$juser]}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" --arg path "${path}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \
|
||||||
'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$host}, "wsSettings":{"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=`echo '{}' | jq --arg host "${host}" --argjson jvnext "${Jvnext}" --argjson jstreamSettings "${JstreamSettings}" \
|
||||||
'. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' `
|
'. += { "tag": "proxy", "protocol":"vmess", "settings":{"vnext":[$jvnext]}, "streamSettings":$jstreamSettings }' `
|
||||||
|
|||||||
38
proxy-ttt.sh
38
proxy-ttt.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-ttt <uuid@domain0.com:443>"
|
>&2 echo "Usage: proxy-ttt <password@domain.com:443>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,23 +10,33 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# password:method@domain0.com:443:/websocket
|
# password@domain.com:443,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
host="${options[0]}"
|
||||||
port="${options[1]}"
|
port="${options[1]}"
|
||||||
path="${options[2]}"
|
passwd="${id}"
|
||||||
|
|
||||||
temp=$id
|
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||||
passwd="${options[0]}"
|
|
||||||
method="${options[1]}"
|
|
||||||
|
|
||||||
if [ -z "${passwd}" ]; then
|
if [ -z "${passwd}" ]; then
|
||||||
>&2 echo "Error: passwd undefined."
|
>&2 echo "Error: password undefined."
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -46,8 +56,8 @@ if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be
|
|||||||
Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \
|
Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "password":$passwd}' `
|
'. += {"address":$host, "port":($port | tonumber), "password":$passwd}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" \
|
||||||
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$host}}' `
|
'. += {"network":"tcp", "security":"tls", "tlsSettings":{"serverName":$serverName, "fingerprint":$fingerprint}}' `
|
||||||
|
|
||||||
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \
|
Jproxy=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \
|
||||||
'. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' `
|
'. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' `
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
>&2 echo "Usage: proxy-tttw <uuid@domain0.com:443:/websocket>"
|
>&2 echo "Usage: proxy-tttw <password@domain.com:443:/websocket>[,serverName=x.org][,fingerprint=safari]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
@@ -10,23 +10,34 @@ if [ -z "$1" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# password:method@domain0.com:443:/websocket
|
# password@domain.com:443:/websocket,serverName=x.org,fingerprint=safari
|
||||||
temp=$1
|
args=(`echo $1 |tr ',' ' '`)
|
||||||
options=(`echo $temp |tr '@' ' '`)
|
dest="${args[0]}"
|
||||||
|
for ext_opt in "${args[@]}"
|
||||||
|
do
|
||||||
|
kv=(`echo $ext_opt |tr '=' ' '`)
|
||||||
|
case "${kv[0]}" in
|
||||||
|
s|serverName)
|
||||||
|
serverName="${kv[1]}"
|
||||||
|
;;
|
||||||
|
f|fingerprint)
|
||||||
|
fingerprint="${kv[1]}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
options=(`echo $dest |tr '@' ' '`)
|
||||||
id="${options[0]}"
|
id="${options[0]}"
|
||||||
temp="${options[1]}"
|
options=(`echo ${options[1]} |tr ':' ' '`)
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
|
||||||
host="${options[0]}"
|
host="${options[0]}"
|
||||||
port="${options[1]}"
|
port="${options[1]}"
|
||||||
path="${options[2]}"
|
path="${options[2]}"
|
||||||
|
passwd="${id}"
|
||||||
|
|
||||||
temp=$id
|
if [ -z "${serverName}" ]; then serverName=${host}; fi
|
||||||
options=(`echo $temp |tr ':' ' '`)
|
if [ -z "${fingerprint}" ]; then fingerprint="safari"; fi
|
||||||
passwd="${options[0]}"
|
|
||||||
method="${options[1]}"
|
|
||||||
|
|
||||||
if [ -z "${passwd}" ]; then
|
if [ -z "${passwd}" ]; then
|
||||||
>&2 echo "Error: passwd undefined."
|
>&2 echo "Error: password undefined."
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -46,8 +57,8 @@ if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo "Port number must be
|
|||||||
Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \
|
Jservers=`echo '{}' | jq --arg host "${host}" --arg port "${port}" --arg passwd "${passwd}" \
|
||||||
'. += {"address":$host, "port":($port | tonumber), "password":$passwd}' `
|
'. += {"address":$host, "port":($port | tonumber), "password":$passwd}' `
|
||||||
|
|
||||||
JstreamSettings=`echo '{}' | jq --arg host "${host}" --arg path "${path}" \
|
JstreamSettings=`echo '{}' | jq --arg serverName "${serverName}" --arg fingerprint "${fingerprint}" --arg path "${path}" \
|
||||||
'. += {"network":"ws", "security":"tls", "tlsSettings":{"serverName":$host}, "wsSettings":{"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=`echo '{}' | jq --arg host "${host}" --argjson jservers "${Jservers}" --argjson jstreamSettings "${JstreamSettings}" \
|
||||||
'. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' `
|
'. += { "tag": "proxy", "protocol":"trojan", "settings":{"servers":[$jservers]}, "streamSettings":$jstreamSettings }' `
|
||||||
|
|||||||
16
run.sh
16
run.sh
@@ -6,14 +6,14 @@ XCONF=/tmp/proxy-xray.json
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "proxy-xray <connection-options>"
|
echo "proxy-xray <connection-options>"
|
||||||
echo " --ltx <VLESS-TCP-XTLS option> id@host:port"
|
echo " --ltx <VLESS-TCP-XTLS option> id@host:port[,s=sniname.org]"
|
||||||
echo " --ltt <VLESS-TCP-TLS option> id@host:port"
|
echo " --ltt <VLESS-TCP-TLS option> id@host:port[,s=sniname.org]"
|
||||||
echo " --lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath"
|
echo " --lttw <VLESS-TCP-TLS-WS option> id@host:port:/webpath[,s=sniname.org]"
|
||||||
echo " --lttg <VLESS-TCP-TLS-GRPC option> id@host:port:/svcpath"
|
echo " --lttg <VLESS-TCP-TLS-GRPC option> id@host:port:/svcpath[,s=sniname.org]"
|
||||||
echo " --mtt <VMESS-TCP-TLS option> id@host:port"
|
echo " --mtt <VMESS-TCP-TLS option> id@host:port[,s=sniname.org]"
|
||||||
echo " --mttw <VMESS-TCP-TLS-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"
|
echo " --ttt <TROJAN-TCP-TLS option> password@host:port[,s=sniname.org]"
|
||||||
echo " --tttw <TROJAN-TCP-TLS-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 " --ssa <Shadowsocks-AEAD option> password:method@host:port"
|
||||||
# echo " --sst <Shadowsocks-TCP option> password:method@host:port"
|
# echo " --sst <Shadowsocks-TCP option> password:method@host:port"
|
||||||
echo " -d|--debug [Optional] Start in debug mode with verbose output"
|
echo " -d|--debug [Optional] Start in debug mode with verbose output"
|
||||||
|
|||||||
Reference in New Issue
Block a user