Skip to content
New issue

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

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

Already on GitHub? # to your account

dokodemo UDP转发不正常 #1195

Closed
cjjdaq opened this issue Jul 14, 2018 · 13 comments
Closed

dokodemo UDP转发不正常 #1195

cjjdaq opened this issue Jul 14, 2018 · 13 comments
Labels

Comments

@cjjdaq
Copy link

cjjdaq commented Jul 14, 2018

Please skip to the English section below if you don't write Chinese.

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

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    手机端使用脚本运行v2ray 连接家里网络。

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    手机端使用dokodemo连接上v2ray后,王者荣耀匹配后无法进入选角界面。换成socks5+redsocks后正常。

  4. 你期待看到的正确表现是怎样的?
    dokodemo能正常转发udp

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

    服务器端配置:

{
    "inbound":{
        "port":8090,
        "protocol":"vmess",
        "settings":{
            "clients":[
                {
                    "id":"8612520b-b9f1-4f21-a79c-9752c292c111",
                    "alterId":100
                }
            ]
        },
        "streamSettings":{
            "network":"tcp",
            "tcpSettings":{
                "connectionReuse":true,
                "header":{
                    "type":"http",
                    "request":{
                        "version":"1.1",
                        "method":"GET",
                        "path":[
                            "/"
                        ],
                        "headers":{
                            "Host":[
                                "www.baidu.com"
                            ],
                            "User-Agent":[
                                "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
                                "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
                            ],
                            "Accept-Encoding":[
                                "gzip, deflate"
                            ],
                            "Connection":[
                                "keep-alive"
                            ],
                            "Pragma":"no-cache"
                        }
                    },
                    "response":{
                        "version":"1.1",
                        "status":"200",
                        "reason":"OK",
                        "headers":{
                            "Content-Type":[
                                "application/octet-stream",
                                "video/mpeg"
                            ],
                            "Transfer-Encoding":[
                                "chunked"
                            ],
                            "Connection":[
                                "keep-alive"
                            ],
                            "Pragma":"no-cache"
                        }
                    }
                }
            }
        }
    },
    "outbound":{
        "protocol":"freedom",
        "settings":{

        }
    },
    "inboundDetour":[

    ],
    "outboundDetour":[
        {
            "protocol":"blackhole",
            "settings":{

            },
            "tag":"blocked"
        }
    ],
    "policy": {
        "levels": {
            "0": {
                "uplinkOnly": 0,
                "downlinkOnly": 0,
                "bufferSize": 1024
            }
        }
    }
客户端配置:
{
    "inbound": {
        "port": 1251,
        "listen": "127.0.0.1",
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": true,
            "ip": "127.0.0.1"
        }
    },
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
    {
                "address": "www.aabbcc.com",
                "port": 8090,
                "users": [{
                    "id": "8612520b-b9f1-4f21-a79c-9752c292c111",
                    "alterId": 100,
                    "security": "auto"
                }]
            }
]
        },
        "streamSettings": {
            "network": "tcp",
            "tcpSettings":{
                "connectionReuse":true,
                "header":{
                    "type":"http",
                    "request":{
                        "version":"1.1",
                        "method":"GET",
                        "path":[
                            "/"
                        ],
                        "headers":{
                            "Host":[
                                "www.baidu.com"
                            ],
                            "User-Agent":[
                                "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
                                "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
                            ],
                            "Accept-Encoding":[
                                "gzip, deflate"
                            ],
                            "Connection":[
                                "keep-alive"
                            ],
                            "Pragma":"no-cache"
                        }
                    },
                    "response":{
                        "version":"1.1",
                        "status":"200",
                        "reason":"OK",
                        "headers":{
                            "Content-Type":[
                                "application/octet-stream",
                                "video/mpeg"
                            ],
                            "Transfer-Encoding":[
                                "chunked"
                            ],
                            "Connection":[
                                "keep-alive"
                            ],
                            "Pragma":"no-cache"
                        }
                    }
                }
            }
        },        "mux": {
            "enabled": true,
            "concurrency": 8
        }
    },
    "inboundDetour": [{
        "listen": "0.0.0.0",
        "domainOverride": ["tls", "http"],
        "protocol": "dokodemo-door",
        "settings": {
            "network": "tcp,udp",
            "followRedirect": true
        },
        "port": 1230
    }],
    "outboundDetour": [{
        "protocol": "freedom",
        "settings": {},
        "tag": "direct"
    }, {
        "protocol": "blackhole",
        "settings": {},
        "tag": "adblock"
    }],
    "policy": {
        "levels": {
            "0": {
                "uplinkOnly": 0,
                "downlinkOnly": 0,
                "bufferSize": 1024
            }
        }
    }
}
@FH0
Copy link
Contributor

FH0 commented Jul 14, 2018

同样的情况,我看v2rayng也是使用tun2socks来处理udp流量,也是这个原因吗

@cjjdaq
Copy link
Author

cjjdaq commented Jul 14, 2018

关键是不想再套一层啊

@VictoriaRaymond
Copy link
Member

你在手机上是怎么把游戏的流量转发到dokodemo的?

@cjjdaq
Copy link
Author

cjjdaq commented Jul 15, 2018

mangle udp转发

-N v2ray_UDP_LAN
-A v2ray_UDP_LAN -d 127.0.0.0/8 -j ACCEPT
-A v2ray_UDP_LAN -d 192.168.0.0/16 -j ACCEPT
-A v2ray_UDP_LAN -d 10.0.0.0/8 -j ACCEPT
-A v2ray_UDP_LAN -d serverip/32 -j ACCEPT
-A v2ray_UDP_LAN -d 224.0.0.0/3 -j ACCEPT
-A v2ray_UDP_LAN -d 0.0.0.0/8 -j ACCEPT
-A v2ray_UDP_LAN -d 172.16.0.0/12 -j ACCEPT
-A v2ray_UDP_LAN -d 100.64.0.0/10 -j ACCEPT
-A v2ray_UDP_LAN -d 169.254.0.0/16 -j ACCEPT

-N v2ray_UDP_OUT
-A v2ray_UDP_OUT -d server_ip/32 -m owner --uid-owner 0 -j ACCEPT
-A v2ray_UDP_OUT -j v2ray_UDP_LAN
-A v2ray_UDP_OUT -p udp -m udp --dport 53 -j ACCEPT
-A v2ray_UDP_OUT -p udp -j MARK --set-xmark 0x6688/0xffffffff

-N v2ray_UDP_PRE
-A v2ray_UDP_PRE -j v2ray_UDP_LAN
-A v2ray_UDP_PRE -p udp -j TPROXY --on-port 1250 --on-ip 0.0.0.0 --tproxy-mark 0x6688/0xffffffff

-I PREROUTING -p udp -j v2ray_UDP_PRE
-I OUTPUT -p udp -j v2ray_UDP_OUT

@YoulianBoshi
Copy link

看不懂

@cjjdaq
Copy link
Author

cjjdaq commented Jul 16, 2018

我使用nc测试udp是通的。但是游戏就玩不了

@p4insh11
Copy link

不用尝试了,NAT type的问题,目前无解,目前只支持双猜

@cjjdaq
Copy link
Author

cjjdaq commented Jul 31, 2018

何为双猜?请指教

@p4insh11
Copy link

NAT4

@judgeou
Copy link

judgeou commented Nov 1, 2018

我也想用V2RAY代理UDP啊 😭 ,但是不管怎么设置都不对,现在只能openvpn才能凑合打游戏

@MashiroYae
Copy link

提个智障解决办法
在主路由下面挂一个服务器跑 V2ray
这个服务器开一个 Shadowsocks 的 inbound

弄一个二级路由装 openWRT 跑 Shadowsocks 客户端

这样就可以转发 UDP 了

@hcym
Copy link

hcym commented Nov 5, 2018

麻烦事儿

@github-actions
Copy link

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants