mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-08 19:28:21 -05:00
32 lines
506 B
Bash
Executable File
32 lines
506 B
Bash
Executable File
#!/bin/bash
|
|
|
|
PORT=27183
|
|
|
|
rand_str () {
|
|
cat /dev/urandom | tr -dc 'a-f0-9' | fold -w $1 | head -n 1
|
|
}
|
|
|
|
ID="$(rand_str 8)-$(rand_str 4)-$(rand_str 4)-$(rand_str 4)-$(rand_str 12)"
|
|
echo "Generated client ID: $ID"
|
|
|
|
cat <<EOF > server-cfg.json
|
|
{
|
|
"log" : {
|
|
"access": "/go/access.log"
|
|
},
|
|
"inbound": {
|
|
"port": $PORT,
|
|
"protocol": "vmess",
|
|
"settings": {
|
|
"clients": [
|
|
{"id": "$ID"}
|
|
]
|
|
}
|
|
},
|
|
"outbound": {
|
|
"protocol": "freedom",
|
|
"settings": {}
|
|
}
|
|
}
|
|
EOF
|