forked from EvgenyNerush/easy-xray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate_config_server.jsonc
288 lines (288 loc) · 9.35 KB
/
template_config_server.jsonc
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
// This config is based on
// https://github.com/XTLS/Xray-examples/blob/main/VLESS-TCP-XTLS-Vision-REALITY/REALITY.ENG.md
{
"log": {
"access": "none",
"error": "",
"loglevel": "warning",
"dnsLog": false
},
// Turns on traffic statistics, see https://xtls.github.io/en/config/stats.html#statsobject
// and https://xtls.github.io/en/config/policy.html#policyobject
// and special "api" tag below
"stats": {
},
"policy": {
"levels": {
// default level
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsOutboundUplink": true,
"statsOutboundDownlink": true
}
},
// enables API interface https://xtls.github.io/en/config/api.html#apiobject
"api": {
"tag": "api",
"services": [ "StatsService" ]
},
// Forward each inbound connections to corresponding `outboundTag`. If no rules match,
// the traffic is sent out by the first outbound in `outbounds` section.
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "api"
},
// guide udp traffic to `block` outbound
{
"type": "field",
"network": "udp",
"outboundTag": "block"
},
// block localhost connections through xray
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
},
// guide bittorent traffic to `block` outbound
{
"type": "field",
"protocol": [ "bittorrent" ],
"outboundTag": "block"
},
// block traffic to popular ports of torrent trackers
// and to popular ports of torrent clients
{
"type": "field",
"port": "6969,6881-6889",
"outboundTag": "block"
},
// block traffic from popular ports of torrent clients
{
"type": "field",
"sourcePort": "6881-6889",
"outboundTag": "block"
},
// exceptions for *.ru websites that shouldn't be blocked
{
"type": "field",
"domain": [
"ext:customgeo.dat:coherence-extra-exceptions"
],
"outboundTag": "direct"
},
// block domestic client traffic if it's coming somehow (e.g. wrong client config)
{
"type": "field",
"domain": [
"geosite:cn",
"domain:cn",
// punycode for national Chinese top-level domains .中国, .中國, .公司, .网络
"domain:xn--fiqs8s",
"domain:xn--fiqz9s",
"domain:xn--55qx5d",
"domain:xn--io0a7i",
"domain:ru",
// punycode for cyrillic Russian top-level domain .рф
"domain:xn--p1ai",
"domain:by",
// punycode for national Belorussian top-level domain .бел
"domain:xn--90ais",
"domain:ir",
// extra domains that are used by domestic sites, see https://github.com/EvgenyNerush/coherence-grabber/tree/main
"ext:customgeo.dat:coherence-extra"
],
"outboundTag": "block"
},
{
"type": "field",
"ip": [
"geoip:cn",
"geoip:ru",
"geoip:by",
"geoip:ir"
],
"outboundTag": "block"
}
]
},
// server-side inbound configuration
"inbounds": [
// gRPC API inbound, used to get statistics
{
"listen": "127.0.0.1",
"port": 8080,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
// main inbound, clients connect to it
{
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
// VLESS settings
"settings": {
"clients": [
{
// can be generated with `xray uuid`
"id": "client_id",
// some email; appears in logs
"email": "client_email",
// Optional; if specified, clients must enable XTLS.
// XTLS is Xray's original technology, which doesn't encrypt TLS traffic (which is already encrypted),
// providing outstanding performance and no fingerprints of double-encrypted TLS.
// XTLS has the same security as TLS.
// https://xtls.github.io/en/config/transport.html#streamsettingsobject
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
// settings of transport protocol, https://xtls.github.io/en/config/transport.html#streamsettingsobject
"streamSettings": {
"network": "tcp",
"security": "reality",
// REALITY fallback options; see also https://xtls.github.io/en/config/features/fallback.html
"realitySettings": {
// optional; if true, outputs debug information
"show": false,
// with failed authentication VLESS will forward traffic to this address
"dest": "www.youtube.com:443",
"xver": 0,
// required; list of server names which client can provide to the server during the handshake.
// (The internet provider sees "serverName" of client config in the client-server traffic, then a censor
// can use this for active probing. Thus, this names should be in accordance with "dest" above.)
"serverNames": [
"www.youtube.com"
],
// required; generate with `xray x25519`; use paired publicKey in client configs
"privateKey": "private_key",
"shortIds": [
// required, list of shortIds available to clients, can be used to distinguish different clients
"short_id"
]
}
},
// used to make transparent proxies, see https://xtls.github.io/en/config/inbound.html#sniffingobject
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": true
}
},
// extra inbound; its main purpose is to get fallback to "dest" at port 80. Many regular websites
// have open ports 80 (http) and 443 (https).
{
"listen": "0.0.0.0",
"port": 80,
"protocol": "vless",
// VLESS settings
"settings": {
"clients": [
{
// can be generated with `xray uuid`
"id": "client_id",
// some email; appears in logs
"email": "client_email",
// Optional; if specified, clients must enable XTLS.
// XTLS is Xray's original technology, which doesn't encrypt TLS traffic (which is already encrypted),
// providing outstanding performance and no fingerprints of double-encrypted TLS.
// XTLS has the same security as TLS.
// https://xtls.github.io/en/config/transport.html#streamsettingsobject
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
// settings of transport protocol, https://xtls.github.io/en/config/transport.html#streamsettingsobject
"streamSettings": {
"network": "tcp",
"security": "reality",
// REALITY fallback options; see also https://xtls.github.io/en/config/features/fallback.html
"realitySettings": {
// optional; if true, outputs debug information
"show": false,
// with failed authentication VLESS will forward traffic to this address
"dest": "www.youtube.com:80",
"xver": 0,
// required; list of server names which client can provide to the server during the handshake.
// (The internet provider sees "serverName" of client config in the client-server traffic, then a censor
// can use this for active probing. Thus, this names should be in accordance with "dest" above.)
"serverNames": [
"www.youtube.com"
],
// required; generate with `xray x25519`; use paired publicKey in client configs
"privateKey": "private_key",
"shortIds": [
// required, list of shortIds available to clients, can be used to distinguish different clients
"short_id"
]
}
},
// used to make transparent proxies, see https://xtls.github.io/en/config/inbound.html#sniffingobject
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": true
}
},
// this inbound can be used with Nginx configured to listen grpc on IPv6 address;
// vless can't give a reasonable fallback when used with grpc, but nginx can;
// see 'CDN' section in Readme for details
{
"tag": "grpc",
"listen": "127.0.0.1",
"port": 50051,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "client_id"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "grpc",
"grpcSettings": {
// nginx config should contain `location /your_service_name`
"serviceName": "your_service_name"
}
}
}
],
// server-side outbound configuration
"outbounds": [
// direct connection; fallback, see `routing` section
{
"protocol": "freedom",
"tag": "direct"
},
// for that should be blocked
{
"protocol": "blackhole",
"tag": "block"
}
]
}