Skip to content

Commit

Permalink
add balancers
Browse files Browse the repository at this point in the history
  • Loading branch information
veekxt committed Nov 16, 2018
1 parent 1fce9dc commit 7b55d88
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v2ray配置生成工具 & 配置文件模板( 4.x )
## v2ray配置生成工具 & 配置文件模板( 4.x )

已经生成了常见组合和配置,如果这里没有你想要的配置,简单的方法是试试这个程序的[在线版本](https://veekxt.com/utils/v2ray_gen)

## 模板说明

`NAT-DDNS` : 内网穿透

`NAT-PROXY` : 相当于使用内网做正向代理,参考[这篇文章](https://toutyrater.github.io/app/reverse2.html)

`tcp+vmess and balance` : 负载均衡
123 changes: 123 additions & 0 deletions tcp+vmess and balance/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"log": {},
"dns": {},
"stats": {},
"inbounds": [
{
"port": "1090",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true
},
"tag": "in-0"
},
{
"port": "1091",
"protocol": "http",
"settings": {},
"tag": "in-1"
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "1.1.1.1",
"port": 3333,
"users": [
{
"id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9",
"alterId": 32
}
]
}
]
},
"tag": "b-out-0"
},
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "2.2.2.2",
"port": 3333,
"users": [
{
"id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9",
"alterId": 32
}
]
}
]
},
"tag": "b-out-1"
},
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"email": "love@v2ray.com",
"address": "3.3.3.3",
"port": 3333,
"method": "aes-128-gcm",
"password": "uyhlfwnawoxeinoi",
"ota": false,
"level": 0
}
]
},
"tag": "b-out-2",
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "direct"
},
{
"type": "field",
"inboundTag": [
"in-0",
"in-1"
],
"balancerTag": "my-balance"
}
],
"balancers": [
{
"tag": "my-balance",
"selector": [
"b-out-"
]
}
]
},
"policy": {},
"reverse": {},
"transport": {}
}
56 changes: 56 additions & 0 deletions tcp+vmess and balance/config_server_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"dns": {},
"stats": {},
"inbounds": [
{
"port": 3333,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9",
"alterId": 32
}
]
},
"tag": "in-0",
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
},
"policy": {},
"reverse": {},
"transport": {}
}
56 changes: 56 additions & 0 deletions tcp+vmess and balance/config_server_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"dns": {},
"stats": {},
"inbounds": [
{
"port": 3333,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9",
"alterId": 32
}
]
},
"tag": "in-0",
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
},
"policy": {},
"reverse": {},
"transport": {}
}
56 changes: 56 additions & 0 deletions tcp+vmess and balance/config_server_3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"dns": {},
"stats": {},
"inbounds": [
{
"port": 3333,
"protocol": "shadowsocks",
"settings": {
"email": "love@v2ray.com",
"method": "aes-128-gcm",
"password": "uyhlfwnawoxeinoi",
"level": 0,
"ota": false,
"network": "tcp,udp"
},
"tag": "in-0",
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
},
"policy": {},
"reverse": {},
"transport": {}
}
1 change: 0 additions & 1 deletion v2ray_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,3 @@ def rand_string(chars, len_c):

if __name__ == "__main__":
(a, b, c, d, e, f) = get_v2ray_config(config_from_t)
print(e)

0 comments on commit 7b55d88

Please sign in to comment.