坛友们有折腾过V2的多协议同时启用这个功能吗?
本帖最后由 MsNeo 于 2019-2-21 16:18 编辑因为现在想在同一台鸡鸡上多开一个MTProto,可是看官网是支持多协议同时启用,可是我试了下怎么也只能单开一个,是少配置了什么东西吗?
配置文件如下:
----------------------------------------------------------------------------------------
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "tg-in",
"port": 8087,
"protocol": "mtproto",
"settings": {
"users": [
{
"secret": "9c32360eee5b71ea685586a189ce3798"
}
]
}
},
{
"tag": "vmess-in",
"port": 8086,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "1f9b35df-4fa4-43b9-87db-82f0d046cf56",
"alterId": 10
}
]
}
}
],
"routing": {
"rules": [
{
"type": "field",
"inboundTag": [
"vmess-in"
],
"outboundTag": "vmess-out"
},
{
"type": "field",
"inboundTag": [
"tg-in"
],
"outboundTag": "tg-out"
}
]
},
"outbounds": [
{
"tag": "tg-out",
"protocol": "mtproto",
"settings": {}
},
{
"tag": "vmess-out",
"protocol": "freedom",
"settings": {}
}
]
}
----------------------------------------------------------------------------------------
报错如下:
failed to read config file at line 7 char 14 > json: cannot unmarshal array into Go struct field Config.inbound of type conf.InboundDetourConfig
可是我上V2官网仔细看了下文档的Inbound,貌似没写多协议同时用的情况。
----------------------------------------------------------------------------------------
修改好了,路由那里少了东西,放上了正确的配置文件了。 "inbounds"
抛砖引玉 发表于 2019-2-21 15:41
"inbounds"
在inbound和outbound都加s了,还是一样的出错,无论如何先谢过 这不是英语干嘛要加s哈哈~只需要保证inbound是一个正确的配置数组[]就可以了。数组里的每一项都是一个入站,每个入站都可以用不同协议。这样就可以了。还有那个路由也不用写那么多其实,它不用写默认就是freedom 本帖最后由 NeverMind 于 2019-2-21 17:59 编辑
太长不看系列,直接贴个我自用的你看着改吧
哦,忘了说,两个用途:1. ss-in,然后用vmess转发出去,2. mtproto-in,然后套个vmess的壳转发出去
[*]{
[*] "log": {
[*] "access": "var/log/v2ray/access.log",
[*] "error": "/var/log/v2ray/error.log",
[*] "loglevel": "warning"
[*] },
[*] "routing": {
[*] "strategy": "rules",
[*] "settings": {
[*] "rules": [
[*] {
[*] "type": "field",
[*] "inboundTag": [
[*] "tg-in"
[*] ],
[*] "outboundTag": "tg-out"
[*] }
[*] ]
[*] }
[*] },
[*] "inbound": {
[*] "port": 8002,
[*] "protocol": "shadowsocks",
[*] "tag": "ss-in",
[*] "settings": {
[*] "method": "aes-256-cfb",
[*] "password": "e8d282b5",
[*] "level": 1,
[*] "network": "tcp,udp"
[*] }
[*] },
[*] "inboundDetour": [
[*] {
[*] "port": 8004,
[*] "protocol": "mtproto",
[*] "tag": "tg-in",
[*] "settings": {
[*] "users": [
[*] {
[*] "secret": "18609"
[*] }
[*] ]
[*] }
[*] }
[*] ],
[*] "outbound": {
[*] "protocol": "vmess",
[*] "tag": "vmess-out",
[*] "settings": {
[*] "vnext": [
[*] {
[*] "address": "tn",
[*] "port": 443,
[*] "users": [
[*] {
[*] "id": "fdfbaf1e",
[*] "alterId": 16,
[*] "security": "auto",
[*] "level": 1
[*] }
[*] ]
[*] }
[*] ]
[*] },
[*] "streamSettings": {
[*] "network": "ws",
[*] "security": "tls",
[*] "wsSettings": {
[*] "path": "/v2ray"
[*] }
[*] }
[*] },
[*] "outboundDetour": [
[*] {
[*] "protocol": "mtproto",
[*] "tag": "tg-out",
[*] "settings": {},
[*] "proxySettings": {
[*] "tag": "vmess-out"
[*] }
[*] }
[*] ]
[*]}
[*]复制代码 其实如果不是多用户多传输协议场景或者全局单个outbounds就可以,tag省略即可
"inbound" : [],
"outbound":[]
配置文件错误,json不能解析
页:
[1]