Skip to content

Commit

Permalink
更多协议
Browse files Browse the repository at this point in the history
  • Loading branch information
danbai225 committed Apr 26, 2024
1 parent 3640dd0 commit 3fbfa56
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/client/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func getOUt(peer *config.Peer) option.Outbound {
case "shadowsocks":
out = option.Outbound{
Type: "shadowsocks",
Tag: "shadowsocks-out",
Tag: "ss-out",
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{
Server: peer.Addr,
Expand Down
2 changes: 1 addition & 1 deletion server/cmd/gpp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {
if ipStr != "" {
fmt.Println("server ip:", ipStr)
// 进行Base64编码
encoded := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("gpp://vless@%s:%d/%s", ipStr, config.Port, config.UUID)))
encoded := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("gpp://%s@%s:%d/%s", config.Protocol, ipStr, config.Port, config.UUID)))
fmt.Println("server token:", encoded)
} else {
fmt.Println("get ip err, please check your network")
Expand Down
24 changes: 23 additions & 1 deletion server/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ read -p "请输入监听地址(默认0.0.0.0): " LISTEN_ADDRESS
LISTEN_ADDRESS=${LISTEN_ADDRESS:-"0.0.0.0"}
read -p "请输入监听端口(默认5123): " LISTEN_PORT
LISTEN_PORT=${LISTEN_PORT:-"5123"}
echo "请选择一个选项:"
echo "1) shadowsocks"
echo "2) socks"
echo "3) vless"
read -p "输入选项 (1-3): " input
PROTOCOL="vless"
case $input in
1)
PROTOCOL="shadowsocks"
;;
2)
PROTOCOL="socks"
;;
3)
PROTOCOL="vless"
;;
*)
echo "无效选项: $input"
exit 0
;;
esac
echo "您选择的协议为: $PROTOCOL"
echo "您输入的监听地址为: $LISTEN_ADDRESS"
echo "您输入的监听端口为: $LISTEN_PORT"
echo "安装路径为: $INSTALL_PATH"
Expand All @@ -21,7 +43,7 @@ echo "Changed to directory: $PWD"
UUID=$(uuidgen)
cat << EOF > config.json
{
"protocol": "vless",
"protocol": "$PROTOCOL",
"port": $LISTEN_PORT,
"addr": "$LISTEN_ADDRESS",
"uuid":"$UUID"
Expand Down

0 comments on commit 3fbfa56

Please sign in to comment.