v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.29k stars 8.94k forks source link

关于vmess中detour的设置 #801

Closed lantowan closed 6 years ago

lantowan commented 6 years ago

中文: 提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。 除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 服务端和客户端都是v3.5 2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 使用socks和vmess,但是要求socks走route限制访问,vmess通过detour直接freedom 3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) 访问超时,调试日志: 访问超时 4) 你期待看到的正确表现是怎样的? socks代理不能访问谷歌,vmess代理可以任意访问 5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
    // 在这里附上服务器端配置文件
{
"log":{
    "loglevel": "debug", 
    "access": "access.log",
    "error": "error.log"
  },

"inbound": {
  "port": 1080,
  "listen": "0.0.0.0",
  "protocol": "socks",
  "settings": {
  "auth": "password",
  "accounts": [
    {
      "user": "test1",
      "pass": "test1"
    },
    {
      "user": "test2",
      "pass": "test2"
    }
              ],
  "udp": true,
  "ip": "0.0.0.0",
  "timeout": 0,
  "userLevel": 0
              }
          },

"inboundDetour": [
  {
     "protocol": "shadowsocks",    
     "port": 1772,    
     "settings": {
        "email": "GameSpeeder@v2ray.com",
        "method": "aes-256-cfb",
        "password": "sspassword",
        "udp": true,
        "level": 0,
        "ota": false
                  }
  },

  {
    "port": 15636,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "EACCD395-B3C2-4687-B632-215019CFA496",
          "alterId": 29
        },
        {
          "id": "57A2D4BE-2F34-4DD6-A3B2-AE1DAA88A289",
          "alterId": 16
        }
                 ],
      "features": {
    "detour": {
      "to": "directxxx"
    }
  }
                }
  }
                  ],

"outbound": {
  "protocol": "freedom",
  "settings": {
              "domainStrategy": "AsIs",
              "timeout": 0,              
              "userLevel": 0
               },
  "tag": "defaultroute"
  },

"outboundDetour": [
{
      "protocol": "freedom",
      "settings": {
"domainStrategy": "UseIp",
  "timeout": 0,
  "userLevel": 0
},
      "tag": "directxxx"
    },
  {
    "protocol": "blackhole",
    "settings": {
                "response": {
                            "type": "none"
                            }
                },
    "tag": "notallowed"

  }
],

"dns": {

    "hosts": {
             "sogou.com": "127.0.0.1"
             },
    "servers": [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },

"routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "chinasites",
          "outboundTag": "defaultroute"
        },
        {
          "type": "chinaip",
          "outboundTag": "defaultroute"
        },
        {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24"
                    ],
                    "outboundTag": "notallowed"
       },
       {
          "type": "field",
          "domain": [
            "google.com",
            "youtube.com",
            "dm.tsdm.tv",
            "dmhy.org",
            "edu.cn",
            "cauc.pw",
            "cloudflare.com",
            "dynamic-ip6.hinet.net",
            "ipv6.halcyons.org",
            "20thingsilearned.com",
            "265.com",
            "2mdn.net",
            "abc.xyz",
            "ac.jp",
            "agoogleaday.com",
            "akamai.net",
            "akamaihd.net",
            "amd.com",
            "ampproject.org",
            "android.com",
            "ansaikuropedia.org",
            "apnic.net",
            "apple.com",
            "appspot.com",
            "arin.net",
            "aspnetcdn.com",
            "bitsnoop.com",
            "blizzard.com",
            "blog.google",
            "blogblog.com",
            "blogger.com",
            "blogspot.com",
            "cdninstagram.com",
            "certificate-transparency.org",
            "chrome.com",
            "chromeexperiments.com",
            "chromercise.com",
            "chromium.org",
            "cloudfront.net",
            "creativelab5.com",
            "dartlang.org",
            "data-vocabulary.org",
            "doubleclick.net",
            "emailintervention.com",
            "facebook.com",
            "facebook.net",
            "fb.com",
            "fbcdn.net",
            "fbsbx.com",
            "feedburner.com",
            "firefox.com",
            "g.cn",
            "g.co",
            "getmdl.io",
            "ggpht.com",
            "gmail.com",
            "gmodules.com",
            "golang.org",
            "goo.gl",
            "google.ae",
            "google.at",
            "google.be",
            "google.ca",
            "google.ch",
            "google.cn",
            "google.com",
            "google.de",
            "google.fi",
            "google.fr",
            "google.it",
            "google.lt",
            "google.lv",
            "google.nl",
            "google.org",
            "google.pl",
            "google.pt",
            "google.ro",
            "google.sk",
            "googleadservices.com",
            "googleadsserving.cn",
            "google-analytics.com",
            "googleapis.com",
            "googleartproject.com",
            "googleblog.com",
            "googlechinawebmaster.com",
            "googlecode.com",
            "googledrive.com",
            "googleechotest.com",
            "googlegroups.com",
            "googlehosted.com",
            "googleinsidesearch.com",
            "googlelabs.com",
            "googlemail.com",
            "googlemashups.com",
            "googlepages.com",
            "googlesource.com",
            "googlesyndication.com",
            "googletagmanager.com",
            "googletagservices.com",
            "googleusercontent.cn",
            "googleusercontent.com",
            "googlevideo.co",
            "googlevideo.com",
            "googlewave.com",
            "googlezeitgeist.com",
            "googlezip.net",
            "gosetsuden.jp",
            "gravatar.com",
            "gstatic.cn",
            "gstatic.com",
            "gvt0.cn",
            "gvt0.com",
            "gvt1.com",
            "gwtproject.org",
            "html5rocks.com",
            "imgur.com",
            "instagram.com",
            "keyhole.com",
            "live.com",
            "localhost",
            "mediawiki.org",
            "messenger.com",
            "software-download.microsoft.com",
            "mozilla.com",
            "mozilla.org",
            "nic.google",
            "nvidia.com",
            "nyt.com",
            "nytimes.com",
            "nytstyle.com",
            "office.net",
            "oneworldmanystories.com",
            "orkut.com",
            "panoramio.com",
            "polymer-project.com",
            "recaptcha.net",
            "registry.google",
            "sxzhchina.com",
            "teachparentstech.org",
            "textcube.com",
            "thefacebook.com",
            "thegobridgeoglepuzzle.com",
            "thegooglepuzzle.com",
            "thinkwithgoogle.com",
            "torproject.org",
            "ubuntu.com",
            "uncyc.org",
            "uncyclomedia.org",
            "uncyclopedia.hk",
            "uncyclopedia.info",
            "uncyclopedia.tw",
            "urchin.com",
            "videolan.org",
            "waveprotocol.org",
            "webm-ccl.org",
            "webmproject.org",
            "wikibooks.org",
            "wikimedia.org",
            "wikimediafoundation.org",
            "wikinews.org",
            "wikipedia.org",
            "wikiquote.org",
            "wikisource.org",
            "wikiversity.org",
            "wiktionary.org",
            "windowsupdate.com",
            "withgoogle.com",
            "yahoo.com",
            "yieldmanager.com",
            "yimg.com",
            "youtu.be",
            "youtube.com",
            "youtube-nocookie.com",
            "ytimg.com"
          ],
          "outboundTag": "notallowed"
        }
      ]
    }
  }

}

    客户端配置:
```javascript
    // 在这里附上客户端配置
{
  "inbound": {
    "port": 1080, // 监听端口
    "protocol": "socks", // 入口协议为 SOCKS 5
    "settings": {
      "auth": "noauth"  //socks的认证设置,noauth 代表不认证,由于 socks 通常在客户端使用,所以这里不认证
    }
  },
  "outbound": {
    "protocol": "vmess", // 出口协议
    "settings": {
      "vnext": [
        {
          "address": "xxxx", // 服务器地址,请修改为你自己的服务器 ip 或域名
          "port": 15636,  // 服务器端口
          "users": [
            {
              "id": "EACCD395-B3C2-4687-B632-215019CFA496",  // 用户 ID,必须与服务器端配置相同
              "alterId": 29 // 此处的值也应当与服务器相同
            }
          ]
        }
      ]
    }
  }
}

6)  请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 `/var/log/v2ray/error.log` 文件中。

    服务器端错误日志:
// 在这里附上服务器端日志

2017/12/30 01:47:35 [Warning]: Core: V2Ray started 2017/12/30 01:47:42 [Info]: Proxy|VMess|Inbound: received request for tcp:www.google.com.hk:80 2017/12/30 01:47:42 [Warning]: Proxy|VMess|Inbound: failed to get detour handler: directxxxApp|Proxyman|Inbound: handler not found: directxxx 2017/12/30 01:47:42 [Info]: App|Dispatcher|Default: taking detour [notallowed] for [tcp:www.google.com.hk:80] 2017/12/30 01:47:43 [Info]: App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe 2017/12/30 01:47:54 [Info]: Proxy|VMess|Inbound: received request for tcp:www.google.com.hk:80 2017/12/30 01:47:54 [Warning]: Proxy|VMess|Inbound: failed to get detour handler: directxxxApp|Proxyman|Inbound: handler not found: directxxx 2017/12/30 01:47:54 [Info]: App|Dispatcher|Default: taking detour [notallowed] for [tcp:www.google.com.hk:80] 2017/12/30 01:47:55 [Info]: App|Proxyman|Inbound: connection ends > Proxy|VMess|Inbound: connection ends > io: read/write on closed pipe

客户端错误日志:
    // 在这里附上客户端日志

7) 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

    // 在这里附上服务器端日志

8) 其它相关的配置文件(如 Nginx)和相关日志。

请预览一下你填的内容再提交。

lantowan commented 6 years ago

不知道为什么错 [Warning]: Proxy|VMess|Inbound: failed to get detour handler: directxxxApp|Proxyman|Inbound: handler not found: directxxx

exosima commented 6 years ago

我的直接浏览不到网页不知道为什么 这个软件要是可以像ssr一样可以支持命令就好了 完全不会用

ToutyRater commented 6 years ago

@lantowan 配置错了。detour to 是转发到另一个inbound 中的,如果要指定某个inbound进来的流量由特定的outbound发出,请使用路由功能

astrataro commented 6 years ago

所以vmess这个detour to到底是干什么用的? 把客户端设置成ss/socks over vmess之类传出代理,然后服务器端vmess用上这个detour to另外的ss/socks的inbound?

699ebe23 commented 6 years ago

https://github.com/v2ray/manual/pull/62 文档已经有修复这个错误。

ToutyRater commented 6 years ago

@astrataro 动态端口