Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2ray在UDP方面代理无法验证成功 #365

Closed
lovetcp opened this issue Jan 18, 2017 · 18 comments
Closed

v2ray在UDP方面代理无法验证成功 #365

lovetcp opened this issue Jan 18, 2017 · 18 comments

Comments

@lovetcp
Copy link

lovetcp commented Jan 18, 2017

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    V2Ray v2.15.1 (One for all) 20170116

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    通过客户端UDP程序访问由V2RAY的UDP代理程序,然后转发到UDP服务。

  3. 你看到的不正常的现象是什么?
    无法连同,通过UDP客户端是可以正常访问UDP服务

  4. 你期待看到的正确表现是怎样的?
    能够正常通过V2RAY的UDP代理实现UDP访问转发

  5. 请附上你的配置文件(提交 Issue 前请隐藏服务器端IP地址)。

      "inboundDetour": [         
      {
        "port": 8098, // 监听端口
        "protocol": "socks", // 入口协议为 SOCKS 5
        "settings": {
          "auth": "noauth",  // 不认证
          "udp": true,     // 开启 UDP 转发
          "ip": "127.0.0.1",
          "timeout": 0
        }
      }
    ],
    "outboundDetour": [
      {
          "protocol": "socks",
          "tag": "udptest",
          "settings": {
              "servers": [{
                  "address": "127.0.0.1",
                  "port": 7901,
                  "users": [
                  {
                      "user": "test user",
                      "pass": "test pass"
                  }
                ]
              }]
          }
      }
    ],
    "routing": {
      "strategy": "rules",
      "settings": {
        "rules": [
            {
              "type": "field",
              "domain": [
                "baidu.com" // 匹配所有包含".goo"的域名,如 www.google.com,www.googleapis.com
              ],
              "outboundTag": "blocked1" // 与 VMess 协议的标签一致,所以匹配上述域名的请求将被中转
            },
            {
            "type": "field",
            "ip": "0.0.0.0/8",  //根据IP进行匹配处理
            "outboundTag": "direct"
            },
            {
            "type": "field",
            "network": "tcp,udp",  //UDP协议?
            "outboundTag": "udptest"
            }
        ]
      }
    }
  1. 请附上出错时软件输出的日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。
    没有日志产生
@v2ray
Copy link
Collaborator

v2ray commented Jan 18, 2017

你贴的配置文件不完整?从你贴的内容来看,你想达到的效果是 socks <-> socks? 如果可以的话,把 loglevel 设为 info 看一下详细的情况。

@lovetcp
Copy link
Author

lovetcp commented Jan 18, 2017 via email

@lovetcp
Copy link
Author

lovetcp commented Jan 18, 2017

{
    "log": {
      "access": "./v2ray_access.log",
      "error": "./v2ray_error.log",
      "loglevel": "debug"   //loglevel: 错误日志的级别,可选的值为"debug"、"info"、"warning"、"error" 和 "none"
    },
    "dns": {
      "hosts": {
        "a.com": "127.0.0.1"
      },
      "servers": [
        "8.8.8.8",
        "8.8.4.4",
        "localhost"
      ]
    },
    "inbound": {
      "port": 8095,
      "listen": "127.0.0.1",
      "protocol": "shadowsocks",
      "settings": {
        "method": "aes-256-cfb", // 加密方式,支持 aes-256-cfb 和 aes-128-cfb
        "password": "v2ray",  // 密码,必须和客户端相同
        "udp": true        // 是否开启 UDP 转发
      }
    },
    "inboundDetour": [           //举例如果只想使用KCP一种inboundDetour的整个段就可以全部删除^_^
      {
        "port": 8096, // 监听端口
        "protocol": "http", // 入口协议为http
        "settings": {
        }
      },
      {
        "port": 8098, // 监听端口
        "protocol": "socks", // 入口协议为 SOCKS 5
        "settings": {
          "auth": "noauth",  // 不认证
          "udp": true,     // 不开启 UDP 转发
          "ip": "127.0.0.1",
          "timeout": 0
        }
      }
    ],
    "outbound": {
      "protocol": "freedom", // 默认直连,只有路由匹配的域名才转发
      "settings": {}
    },
    "outboundDetour": [
      {
        "protocol": "shadowsocks",   // 开启 Shadowsocks
        "tag": "blocked1",
        "settings": {
            "servers": [
              {
                "address": "127.0.0.1",
                "port": 8097,
                "method": "aes-256-cfb",
                "password": "6eb7d9$fac98e78f",
                "ota": false
              }
            ]
         }
      },
      {
          "protocol": "socks",
          "tag": "udptest",
          "settings": {
              "servers": [{
                  "address": "127.0.0.1",
                  "port": 7901,
                  "users": [
                  {
                      "user": "test user",
                      "pass": "test pass"
                  }
                ]
              }]
          }
      }
    ],
    "routing": {
      "strategy": "rules",
      "settings": {
        "rules": [
            {
              "type": "field",
              "domain": [
                "baidu.com" // 匹配所有包含".goo"的域名,如 www.google.com,www.googleapis.com
              ],
              "outboundTag": "blocked1" // 与 VMess 协议的标签一致,所以匹配上述域名的请求将被中转
            },
            {
            "type": "field",
            "ip": "0.0.0.0/8",  //根据IP进行匹配处理
            "outboundTag": "direct"
            },
            {
            "type": "field",
            "network": "tcp,udp",  //UDP协议?
            "outboundTag": "udptest"
            }
        ]
      }
    }
}

@lovetcp
Copy link
Author

lovetcp commented Jan 18, 2017

我是通过8098去做UDP代理访问

@lovetcp
Copy link
Author

lovetcp commented Jan 18, 2017

V2TAY支持UDP转发的会话管理么?

@v2ray
Copy link
Collaborator

v2ray commented Jan 18, 2017

你的 log 能看出两个问题:

  1. 8095 (Shadowsocks) 端口被其它程序占用;
  2. Socks 收到的 UDP 请求是 fragmented。这种格式的请求暂时不支持。你的 socks 客户端是什么? QQ?

@lovetcp
Copy link
Author

lovetcp commented Jan 19, 2017

是的,是类似与QQ的。

@v2ray
Copy link
Collaborator

v2ray commented Jan 29, 2017

fragmented UDP 转发暂时没有实现,如果你能提供具体的客户端信息,我可以调试一下。

V2TAY支持UDP转发的会话管理么?

什么是会话管理?

@lovetcp
Copy link
Author

lovetcp commented Feb 4, 2017

我 无法上传zip文件。。可以如何发给你?

@v2ray
Copy link
Collaborator

v2ray commented Feb 6, 2017

发邮件到 love@v2ray.com,或者各种网盘都可以

@lovetcp
Copy link
Author

lovetcp commented Feb 7, 2017 via email

@lovetcp
Copy link
Author

lovetcp commented Feb 7, 2017

链接:http://pan.baidu.com/s/1cMkWhC 密码:5mvi

@v2ray
Copy link
Collaborator

v2ray commented Feb 7, 2017

已下载,你能不能解释一下每一个文件的作用,以及如何使用?

@lovetcp
Copy link
Author

lovetcp commented Feb 8, 2017

那个demos.zip中存在两个可以执行程序,一个是客户端,可以启动多个,一个是服务端。
客户端:
windows环境下,
cmd
cd client目录下
执行java -jar MobileIMSDKDemo-Java.jar,就能进入客户端。
服务端:
cmd
cd server
run.bat既可

@lovetcp
Copy link
Author

lovetcp commented Feb 17, 2017

请问有进展么?

@lovetcp
Copy link
Author

lovetcp commented Feb 21, 2017

请问这个有进展么?

@v2ray
Copy link
Collaborator

v2ray commented Feb 21, 2017

暂时还没有时间研究这个

@DarienRaymond
Copy link
Contributor

你需要一个 socks 代理来转发 UDP 数据,而不是单纯把 UDP 数据发往 socks 的 UDP 端口。或者使用 dokodemo-door 的透明代理功能。

github-actions bot pushed a commit to 3gZ2jA/v2ray-core that referenced this issue Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants