全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1745|回复: 6

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

[复制链接]
发表于 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,貌似没写多协议同时用的情况。
----------------------------------------------------------------------------------------
修改好了,路由那里少了东西,放上了正确的配置文件了。
发表于 2019-2-21 15:41:12 | 显示全部楼层
"inbounds"
 楼主| 发表于 2019-2-21 15:49:27 | 显示全部楼层

在inbound和outbound都加s了,还是一样的出错,无论如何先谢过
发表于 2019-2-21 16:07:24 来自手机 | 显示全部楼层
这不是英语干嘛要加s哈哈~只需要保证inbound是一个正确的配置数组[]就可以了。数组里的每一项都是一个入站,每个入站都可以用不同协议。这样就可以了。还有那个路由也不用写那么多其实,它不用写默认就是freedom
发表于 2019-2-21 17:49:13 | 显示全部楼层
本帖最后由 NeverMind 于 2019-2-21 17:59 编辑

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

  1. {
  2.     "log": {
  3.         "access": "var/log/v2ray/access.log",
  4.         "error": "/var/log/v2ray/error.log",
  5.         "loglevel": "warning"
  6.     },
  7.     "routing": {
  8.         "strategy": "rules",
  9.         "settings": {
  10.             "rules": [
  11.                 {
  12.                     "type": "field",
  13.                     "inboundTag": [
  14.                         "tg-in"
  15.                     ],
  16.                     "outboundTag": "tg-out"
  17.                 }
  18.             ]
  19.         }
  20.     },
  21.     "inbound": {
  22.         "port": 8002,
  23.         "protocol": "shadowsocks",
  24.         "tag": "ss-in",
  25.         "settings": {
  26.             "method": "aes-256-cfb",
  27.             "password": "e8d282b5",
  28.             "level": 1,
  29.             "network": "tcp,udp"
  30.         }
  31.     },
  32.     "inboundDetour": [
  33.         {
  34.             "port": 8004,
  35.             "protocol": "mtproto",
  36.             "tag": "tg-in",
  37.             "settings": {
  38.                 "users": [
  39.                     {
  40.                         "secret": "18609"
  41.                     }
  42.                 ]
  43.             }
  44.         }
  45.     ],
  46.     "outbound": {
  47.         "protocol": "vmess",
  48.         "tag": "vmess-out",
  49.         "settings": {
  50.             "vnext": [
  51.                 {
  52.                     "address": "tn",
  53.                     "port": 443,
  54.                     "users": [
  55.                         {
  56.                             "id": "fdfbaf1e",
  57.                             "alterId": 16,
  58.                             "security": "auto",
  59.                             "level": 1
  60.                         }
  61.                     ]
  62.                 }
  63.             ]
  64.         },
  65.         "streamSettings": {
  66.             "network": "ws",
  67.             "security": "tls",
  68.             "wsSettings": {
  69.                 "path": "/v2ray"
  70.             }
  71.         }
  72.     },
  73.     "outboundDetour": [
  74.         {
  75.             "protocol": "mtproto",
  76.             "tag": "tg-out",
  77.             "settings": {},
  78.             "proxySettings": {
  79.                 "tag": "vmess-out"
  80.             }
  81.         }
  82.     ]
  83. }
复制代码
发表于 2019-2-21 21:16:00 | 显示全部楼层
其实如果不是多用户多传输协议场景或者全局单个outbounds就可以,tag省略即可
发表于 2019-2-21 21:30:56 | 显示全部楼层
"inbound" : [],
"outbound":[]
配置文件错误,json不能解析
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-26 18:38 , Processed in 0.071470 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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