Last active
June 24, 2023 06:08
-
-
Save sae13/3464a3ed51ed83ef2c868ea8349cc883 to your computer and use it in GitHub Desktop.
install ss+xray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export version_vray="$(curl -L -s -o /dev/null -w %{url_effective} https://github.com/shadowsocks/v2ray-plugin/releases/latest|rev|cut -d/ -f1|rev)" | |
export version_xray="$(curl -L -s -o /dev/null -w %{url_effective} https://github.com/teddysun/xray-plugin/releases/latest|rev|cut -d/ -f1|rev)" | |
export version_ss="$(curl -L -s -o /dev/null -w %{url_effective} https://github.com/shadowsocks/shadowsocks-rust/releases/latest|rev|cut -d/ -f1|rev)" | |
export version_singbox="$(curl -L -s -o /dev/null -w %{url_effective} https://github.com/SagerNet/sing-box/releases/latest|rev|cut -d/ -f1|rev)" | |
export v_singbox="${version_singbox:1}" | |
export url_vray="https://github.com/shadowsocks/v2ray-plugin/releases/download/$version_vray/v2ray-plugin-linux-amd64-$version_vray.tar.gz" | |
export url_xray="https://github.com/teddysun/xray-plugin/releases/download/$version_xray/xray-plugin-linux-amd64-$version_xray.tar.gz" | |
export url_ss="https://github.com/shadowsocks/shadowsocks-rust/releases/download/$version_ss/shadowsocks-$version_ss.x86_64-unknown-linux-gnu.tar.xz" | |
export url_singbox="https://github.com/SagerNet/sing-box/releases/download/$version_singbox/sing-box-$v_singbox-linux-amd64.tar.gz" | |
export sspath=$HOME/.local/bin | |
mkdir -p $sspath >/dev/null 2>&1 | |
mkdir /tmp/ss >/dev/null 2>&1 | |
cd $sspath | |
echo "downloading vray plugin: $url_vray" | |
curl -LOs $url_vray | |
echo "downloading xray plugin: $url_xray" | |
curl -LOs $url_xray | |
echo "downladong ss: $url_ss" | |
curl -LOs $url_ss | |
echo "downladong singbox: $url_singbox" | |
curl -LOs $url_singbox | |
tar -xf shadowsocks-$version_ss.x86_64-unknown-linux-gnu.tar.xz | |
tar -xf v2ray-plugin-linux-amd64-$version_vray.tar.gz | |
tar -xf xray-plugin-linux-amd64-$version_xray.tar.gz | |
tar -xf sing-box-$v_singbox-linux-amd64.tar.gz | |
mv shadowsocks-$version_ss.x86_64-unknown-linux-gnu.tar.xz /tmp/ss | |
mv xray-plugin-linux-amd64-$version_xray.tar.gz /tmp/ss | |
mv v2ray-plugin-linux-amd64-$version_vray.tar.gz /tmp/ss | |
mv sing-box-$v_singbox-linux-amd64.tar.gz /tmp/ss | |
mv sing-box-$v_singbox-linux-amd64/sing-box . | |
mv sing-box-$v_singbox-linux-amd64/ /tmp | |
chmod +x $sspath/ssservice | |
export password_="$(head -c 8 /dev/random|xxd -ps)" | |
echo "$sspath/ssservice server -s 127.0.0.1:11080 -k $password_ -m aes-256-gcm --plugin $sspath/xray-plugin_linux_amd64 --plugin-opts 'server;path=/post' -v" | |
echo "$sspath/ssservice server -s 127.0.0.1:21080 -k $password_ -m aes-256-gcm --plugin $sspath/v2ray-plugin_linux_amd64 --plugin-opts 'server;path=/post' -v" | |
echo client | |
echo "$sspath/ssservice local --server-addr SERVER_ADDRESS:443 --encrypt-method aes-256-gcm -k $password_ --local-addr 0.0.0.0:1080 --plugin $sspath/v2ray-plugin_linux_amd64 --plugin-opts 'tls;host=SERVER_ADDRESS;path=/post' -v" | |
echo "$sspath/ssservice local --server-addr SERVER_ADDRESS:443 --encrypt-method aes-256-gcm -k $password_ --local-addr 0.0.0.0:1080 --plugin $sspath/xray-plugin_linux_amd64 --plugin-opts 'tls;host=SERVER_ADDRESS;path=/post' -v" | |
echo " | |
{ | |
"inbounds": [ | |
{ | |
"type": "vless", | |
"tag": "vless-in", | |
"listen": "::", | |
"listen_port": 2443, | |
"sniff": true, | |
"sniff_override_destination": true, | |
"domain_strategy": "ipv4_only", | |
"users": [ | |
{ | |
"uuid": "E66E8785-9284-493D-BF48-8232AA3686EA", //با این دستور بسازید ./sing-box generate uuid | |
"flow": "xtls-rprx-vision" | |
} | |
], | |
"tls": { | |
"enabled": true, | |
"server_name": "xxxxxxx", //طبق توضیحات در اموزش SNI پیدا کنید | |
"reality": { | |
"enabled": true, | |
"handshake": { | |
"server": "xxxxxxx", //طبق توضیحات در اموزش SNI پیدا کنید | |
"server_port": 443 | |
}, | |
"private_key": "qAdSu-xtsEOlP-xfysiAdiU-NxUBWmxZ63OOnTEMFFk", //با این دستور بسازید ./sing-box generate reality-keypair | |
"short_id": [ | |
"6ba85179e30d4fc2" //با این دستور بسازید ./sing-box generate rand --hex 8 | |
] | |
} | |
} | |
} | |
], | |
"outbounds": [ | |
{ | |
"type": "direct", | |
"tag": "direct" | |
}, | |
{ | |
"type": "block", | |
"tag": "block" | |
} | |
] | |
} | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment