2017-11-25 18:26:29 +08:00
|
|
|
# vTemplate
|
2017-11-28 23:11:54 +08:00
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
这是一个社会实验性质的项目,提供标准的 V2Ray 配置模板。
|
2020-07-31 16:00:08 +08:00
|
|
|
|
|
|
|
## 贡献指南
|
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
欢迎你将自己使用的配置制作模板,提交 PR。
|
2020-07-31 16:00:08 +08:00
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
模板应遵守以下标准:
|
2020-07-31 19:14:59 +08:00
|
|
|
- 缩进使用 4 个空格
|
2020-07-31 18:37:13 +08:00
|
|
|
- 方 (花) 括号不换行
|
|
|
|
- 不需要的字段应该移除
|
|
|
|
- `log` 部分只留 `loglevel`
|
|
|
|
- 对于 `outbounds`,客户端应有 `proxy` 和 `direct`,服务端应有 `direct` 和 `block`
|
2020-07-31 20:44:15 +08:00
|
|
|
- 除非是适用于特定场景的模板,否则应当将 `geoip:private` 路由到 `direct` 出站 (服务端配置路由到 `block` 出站)
|
|
|
|
- 除非是适用于特定场景的模板,否则配置文件中不应出现 DNS
|
2020-07-31 18:37:13 +08:00
|
|
|
- `uuid` 应留空,由用户自行填写。
|
|
|
|
- `routing` 中的 `domainStrategy` 保持默认,即 `AsIs`。
|
2020-07-31 16:00:08 +08:00
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
### 举例
|
2020-07-31 16:00:08 +08:00
|
|
|
|
2020-07-31 18:42:52 +08:00
|
|
|
```yaml
|
2020-07-31 16:00:08 +08:00
|
|
|
{
|
2020-07-31 19:23:33 +08:00
|
|
|
"log": {
|
2020-07-31 11:26:35 +00:00
|
|
|
"loglevel": "warning"
|
2020-07-31 19:23:33 +08:00
|
|
|
},
|
|
|
|
"routing": {},
|
|
|
|
"inbounds": [],
|
|
|
|
"outbounds": []
|
2020-07-31 16:00:08 +08:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### 客户端
|
|
|
|
|
2020-07-31 18:42:52 +08:00
|
|
|
```yaml
|
2020-07-31 16:00:08 +08:00
|
|
|
{
|
2020-07-31 19:23:33 +08:00
|
|
|
"log": {
|
|
|
|
"loglevel": "warning"
|
|
|
|
},
|
|
|
|
"routing": {
|
|
|
|
"domainStrategy": "AsIs",
|
|
|
|
"rules": [
|
|
|
|
{
|
|
|
|
"ip": [
|
|
|
|
"geoip:private"
|
|
|
|
],
|
|
|
|
"outboundTag": "direct",
|
|
|
|
"port": null,
|
|
|
|
"type": "field"
|
|
|
|
}
|
2020-07-31 16:00:08 +08:00
|
|
|
]
|
2020-07-31 19:23:33 +08:00
|
|
|
},
|
|
|
|
"inbounds": [
|
|
|
|
{
|
2020-07-31 20:43:27 +08:00
|
|
|
"port": 1080,
|
|
|
|
"protocol": "socks",
|
|
|
|
"settings": {
|
|
|
|
"auth": "noauth",
|
|
|
|
"udp": true
|
|
|
|
},
|
|
|
|
"tag": "socks"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"outbounds": [
|
|
|
|
{
|
2020-07-31 19:23:33 +08:00
|
|
|
"protocol": "vmess",
|
|
|
|
"settings": {
|
2020-07-31 20:43:27 +08:00
|
|
|
"vnext": [
|
2020-07-31 19:23:33 +08:00
|
|
|
{
|
2020-07-31 20:43:27 +08:00
|
|
|
"users": [
|
|
|
|
{
|
|
|
|
"alterId": 100,
|
|
|
|
"security": "aes-128-gcm",
|
|
|
|
"id": "",
|
|
|
|
"testsEnabled": "VMessAEAD"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"port": 1234,
|
|
|
|
"address": "Your_IP_Address"
|
2020-07-31 19:23:33 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"streamSettings": {
|
|
|
|
"network": "tcp"
|
2020-07-31 20:43:27 +08:00
|
|
|
},
|
|
|
|
"tag": "proxy"
|
|
|
|
},
|
2020-07-31 19:23:33 +08:00
|
|
|
{
|
|
|
|
"protocol": "freedom",
|
|
|
|
"settings": {
|
|
|
|
},
|
|
|
|
"tag": "direct"
|
|
|
|
}
|
|
|
|
]
|
2020-07-31 16:00:08 +08:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### 服务端
|
|
|
|
|
2020-07-31 18:42:52 +08:00
|
|
|
```yaml
|
2020-07-31 16:00:08 +08:00
|
|
|
{
|
2020-07-31 19:23:33 +08:00
|
|
|
"log": {
|
|
|
|
"loglevel": "warning"
|
|
|
|
},
|
|
|
|
"routing": {
|
|
|
|
"domainStrategy": "AsIs",
|
|
|
|
"rules": [
|
|
|
|
{
|
|
|
|
"ip": [
|
|
|
|
"geoip:private"
|
|
|
|
],
|
|
|
|
"outboundTag": "blocked",
|
|
|
|
"port": null,
|
|
|
|
"type": "field"
|
|
|
|
}
|
2020-07-31 16:00:08 +08:00
|
|
|
]
|
|
|
|
},
|
2020-07-31 19:23:33 +08:00
|
|
|
"inbounds": [
|
|
|
|
{
|
|
|
|
"port": 1234,
|
|
|
|
"protocol": "vmess",
|
|
|
|
"settings": {
|
|
|
|
"clients": [
|
|
|
|
{
|
2020-07-31 20:43:27 +08:00
|
|
|
"id": "",
|
2020-07-31 19:23:33 +08:00
|
|
|
"alterId": 100,
|
|
|
|
"testsEnabled": "VMessAEAD"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"tag": "tcp",
|
|
|
|
"streamSettings": {
|
|
|
|
"network": "tcp"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"outbounds": [
|
|
|
|
{
|
|
|
|
"protocol": "freedom",
|
|
|
|
"settings": {
|
|
|
|
},
|
|
|
|
"tag": "direct"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"protocol": "blackhole",
|
|
|
|
"settings": {
|
|
|
|
},
|
|
|
|
"tag": "blocked"
|
|
|
|
}
|
|
|
|
]
|
2020-07-31 16:00:08 +08:00
|
|
|
}
|
|
|
|
```
|
2017-12-09 19:03:50 +08:00
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
## 如何选取适合自己的配置:
|
|
|
|
|
|
|
|
![](how-to-choose/how-to-choose-a-v2ray-plan.png)
|
|
|
|
|
|
|
|
附加说明:<br>
|
|
|
|
尽管 Websocket+TLS+Web 可能称得上是现阶段最好的方案,但**绝对**不是推荐新手一上来就尝试的方案,更不是 V2Ray 唯一的用法。<br>
|
|
|
|
同时,你应当了解,每个地区的网络状况不同 (主要指对不同协议的 QoS 程度),你可以将所有配置都尝试一遍来寻找最适合自己的,尽量少问、最好不问“为什么我的 V2Ray 这么慢?”这样的问题。
|
|
|
|
|
2020-07-31 16:00:08 +08:00
|
|
|
## 最后
|
2017-11-28 23:11:54 +08:00
|
|
|
|
2020-07-31 18:37:13 +08:00
|
|
|
祝你玩的愉快,感谢原始作者 KiriKira 和 Project V 的所有开发人员,以及 v2ray.fun 的作者。
|