找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 42|回复: 6

坛友们有折腾过V2的多协议同时启用这个功能吗?

[复制链接]

51

主题

357

回帖

943

积分

高级会员

积分
943
发表于 2019-2-21 15:36:15 | 显示全部楼层 |阅读模式
本帖最后由 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,貌似没写多协议同时用的情况。
----------------------------------------------------------------------------------------
修改好了,路由那里少了东西,放上了正确的配置文件了。
回复

使用道具 举报

39

主题

287

回帖

737

积分

高级会员

积分
737
发表于 2019-2-21 15:41:12 | 显示全部楼层
"inbounds"
回复

使用道具 举报

51

主题

357

回帖

943

积分

高级会员

积分
943
 楼主| 发表于 2019-2-21 15:49:27 | 显示全部楼层

抛砖引玉 发表于 2019-2-21 15:41

"inbounds"

在inbound和outbound都加s了,还是一样的出错,无论如何先谢过
回复

使用道具 举报

15

主题

398

回帖

875

积分

高级会员

积分
875
发表于 2019-2-21 15:41:00 | 显示全部楼层
这不是英语干嘛要加s哈哈~只需要保证inbound是一个正确的配置数组[]就可以了。数组里的每一项都是一个入站,每个入站都可以用不同协议。这样就可以了。还有那个路由也不用写那么多其实,它不用写默认就是freedom
回复

使用道具 举报

6

主题

36

回帖

110

积分

注册会员

积分
110
发表于 2019-2-21 16:07:24 | 显示全部楼层
本帖最后由 NeverMind 于 2019-2-21 17:59 编辑

太长不看系列,直接贴个我自用的你看着改吧
哦,忘了说,两个用途:1. ss-in,然后用vmess转发出去,2. mtproto-in,然后套个vmess的壳转发出去

[ol]
  • {
  •     "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"
  •             }
  •         }
  •     ]
  • }
  • [/ol]复制代码
  • 回复

    使用道具 举报

    20

    主题

    326

    回帖

    724

    积分

    高级会员

    积分
    724
    发表于 2019-2-21 17:49:13 | 显示全部楼层
    其实如果不是多用户多传输协议场景或者全局单个outbounds就可以,tag省略即可
    回复

    使用道具 举报

    68

    主题

    384

    回帖

    1016

    积分

    金牌会员

    积分
    1016
    发表于 2019-2-21 21:16:00 | 显示全部楼层
    "inbound" : [],
    "outbound":[]
    配置文件错误,json不能解析
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-4-20 04:00 , Processed in 0.017541 second(s), 4 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表