Check obfs
This commit is contained in:
@ -25,7 +25,6 @@ get_normalsub_domain_and_port() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
show_uri() {
|
show_uri() {
|
||||||
if [ -f "$USERS_FILE" ]; then
|
if [ -f "$USERS_FILE" ]; then
|
||||||
if systemctl is-active --quiet hysteria-server.service; then
|
if systemctl is-active --quiet hysteria-server.service; then
|
||||||
@ -60,16 +59,24 @@ show_uri() {
|
|||||||
authpassword=$(jq -r ".\"$username\".password" "$USERS_FILE")
|
authpassword=$(jq -r ".\"$username\".password" "$USERS_FILE")
|
||||||
port=$(jq -r '.listen' "$CONFIG_FILE" | cut -d':' -f2)
|
port=$(jq -r '.listen' "$CONFIG_FILE" | cut -d':' -f2)
|
||||||
sha256=$(jq -r '.tls.pinSHA256' "$CONFIG_FILE")
|
sha256=$(jq -r '.tls.pinSHA256' "$CONFIG_FILE")
|
||||||
obfspassword=$(jq -r '.obfs.salamander.password' "$CONFIG_FILE")
|
obfspassword=$(jq -r '.obfs.salamander.password // empty' "$CONFIG_FILE")
|
||||||
|
|
||||||
generate_uri() {
|
generate_uri() {
|
||||||
local ip_version=$1
|
local ip_version=$1
|
||||||
local ip=$2
|
local ip=$2
|
||||||
|
if [ -n "$obfspassword" ]; then
|
||||||
if [ "$ip_version" -eq 4 ]; then
|
if [ "$ip_version" -eq 4 ]; then
|
||||||
echo "hy2://$username%3A$authpassword@$ip:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv4"
|
echo "hy2://$username%3A$authpassword@$ip:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv4"
|
||||||
elif [ "$ip_version" -eq 6 ]; then
|
elif [ "$ip_version" -eq 6 ]; then
|
||||||
echo "hy2://$username%3A$authpassword@[$ip]:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv6"
|
echo "hy2://$username%3A$authpassword@[$ip]:$port?obfs=salamander&obfs-password=$obfspassword&pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv6"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if [ "$ip_version" -eq 4 ]; then
|
||||||
|
echo "hy2://$username%3A$authpassword@$ip:$port?pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv4"
|
||||||
|
elif [ "$ip_version" -eq 6 ]; then
|
||||||
|
echo "hy2://$username%3A$authpassword@[$ip]:$port?pinSHA256=$sha256&insecure=1&sni=$SNI#$username-IPv6"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$show_all" = true ]; then
|
if [ "$show_all" = true ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user