forked from james986g/https-website-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
60 lines (56 loc) · 2.29 KB
/
configure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
# Download and install xray
mkdir /tmp/xray
curl -L -H "Cache-Control: no-cache" -o /tmp/xray/xray.zip https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip
unzip /tmp/xray/xray.zip -d /tmp/xray
install -m 755 /tmp/xray/xray /usr/local/bin/xray
# Remove temporary directory
rm -rf /tmp/xray
# xray new configuration
install -d /usr/local/etc/xray
cat << EOF > /usr/local/etc/xray/config.json
{
"log": {
"loglevel": "warning"
},
"inbound": {
"protocol": "VMess",
"port": 8080,
"settings": {
"clients": [{
"id": "73419d1a-cbd6-4b6f-db1d-38d78b3fb109",
"alterId": 64,
"security": "chacha20-poly1305"
}]
},
"streamSettings": {
"network": "tcp",
"httpSettings": {
"path": "/"
},
"tcpSettings": {
"header": {
"type": "http",
"response": {
"version": "1.1",
"status": "200",
"reason": "OK",
"headers": {
"Content-Type": ["application/octet-stream", "application/x-msdownload", "text/html", "application/x-shockwave-flash"],
"Transfer-Encoding": ["chunked"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
}
}
}
}
},
"inboundDetour": [],
"outbound": {
"protocol": "freedom",
"settings": {}
}
}
# Run xray
/usr/local/bin/xray -config /usr/local/etc/xray/config.json