Code Monkey home page Code Monkey logo

v2ray-core's Introduction

V2Ray

Project V

Project V is a set of network tools that helps you to build your own computer network. It secures your network connections and thus protects your privacy.

GitHub Test Badge codecov.io codebeat Codacy Badge Downloads

Related Links

Packaging Status

If you are willing to package V2Ray for other distros/platforms, please let us know or seek for help via GitHub issues.

Packaging status

License

The MIT License (MIT)

Credits

This repo relies on the following third-party projects:

v2ray-core's People

Contributors

actions-user avatar akinokaede avatar chinsyo avatar darhwa avatar darienraymond avatar database64128 avatar dependabot[bot] avatar ducksoft avatar dyhkwong avatar ehfive avatar felixonmars avatar kslr avatar loyalsoldier avatar lucifer9 avatar nekohasekai avatar qjebbs avatar rprx avatar rurirei avatar sunshineplan avatar toutyrater avatar unknowndevqwq avatar vcptr avatar victoriaraymond avatar vigilans avatar wuxiangzhou2010 avatar xiaokangwang avatar xymopen avatar yin1999 avatar yuhan6665 avatar yujinqiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

v2ray-core's Issues

内置 DNS 解析 localhost 返回 invalid domain name

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

4.27.0

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

将 V2Ray 放在一台服务器上,然后局域网的电脑使用微信设置代理指向这台服务器的 IP

服务器IP:192.168.1.224

  1. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

内置 DNS 解析 localhost 时返回 failed to get IP address for domain localhost已经在 hosts 中指定 localhost:127.0.0.1

微信表现为无法发送图片,能接收图片

  1. 你期待看到的正确表现是怎样的?

localhost 可以被正常解析

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

服务器端配置:

   

客户端配置:

{
  "log": {
    "loglevel": "info",
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log"
  },
  "inbounds": [
    {
      "port": 1080,
      "listen": "192.168.1.224",
      "protocol": "http",
      "tag": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ],
  "outbounds": [
    {
      "sendThrough": "192.168.0.100",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "",
            "port": 443,
            "users": [
              {
                "id": "",
                "security": "auto",
                "level": 0
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": false,
          "disableSessionResumption": true
        },
        "sockopt": {
          "tcpFastOpen": true
        }
      }
    },
    {
      "sendThrough": "192.168.1.224",
      "protocol": "freedom",
      "settings": {},
      "tag": "in-direct"
    },
    {
      "sendThrough": "192.168.0.100",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIP",
        "userLevel": 0
      },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "tag": "blocked"
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "domain": [
          "geosite:ads"
        ],
        "outboundTag": "blocked"
      },
      {
        "type": "field",
        "domain": [
          "localhost",
          "geosite:cn"
        ],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "in-direct"
      },
      {
        "type": "field",
        "ip": [
          "geoip:cn"
        ],
        "outboundTag": "direct"
      }
    ]
  },
  "dns": {
    "hosts": {
      "localhost": "127.0.0.1"
    },
    "servers": [
      {
        "address": "127.0.0.1",
        "port": 1053,
        "domains": [
          "geosite:cn"
        ],
        "expectIPs": [
          "geoip:cn"
        ]
      },
      "1.1.1.1",
      "8.8.8.8"
    ],
    "clientIp": ""
  },
  "policy": {
    "levels": {
      "0": {
        "uplinkOnly": 0,
        "downlinkOnly": 0
      }
    }
  }
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

    

客户端错误日志:

2020/08/21 10:12:43 [Warning] [3523820987] v2ray.com/core/proxy/freedom: failed to get IP address for domain localhost > v2ray.com/core/app/dns: invalid domain name
2020/08/21 10:12:43 [Info] [3523820987] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:localhost:50051
2020/08/21 10:12:43 [Warning] [3523820987] v2ray.com/core/proxy/freedom: failed to get IP address for domain localhost > v2ray.com/core/app/dns: invalid domain name
2020/08/21 10:12:43 [Info] [3523820987] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:localhost:50051
2020/08/21 10:12:43 [Warning] [3523820987] v2ray.com/core/proxy/freedom: failed to get IP address for domain localhost > v2ray.com/core/app/dns: invalid domain name
2020/08/21 10:12:43 [Info] [3523820987] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:localhost:50051
2020/08/21 10:12:43 [Warning] [3523820987] v2ray.com/core/proxy/freedom: failed to get IP address for domain localhost > v2ray.com/core/app/dns: invalid domain name
2020/08/21 10:12:43 [Info] [3523820987] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:localhost:50051
2020/08/21 10:12:44 [Warning] [3523820987] v2ray.com/core/proxy/freedom: failed to get IP address for domain localhost > v2ray.com/core/app/dns: invalid domain name
2020/08/21 10:12:44 [Info] [3523820987] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:localhost:50051
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
2020/08/21 10:11:35 192.168.1.94:55056 accepted //localhost:50052 [direct] 
2020/08/21 10:11:39 192.168.1.94:55057 accepted //localhost:50053 [direct] 
2020/08/21 10:11:43 192.168.1.94:55058 accepted //localhost:50051 [direct] 
2020/08/21 10:11:47 192.168.1.94:55059 accepted //localhost:50052 [direct] 
2020/08/21 10:11:51 192.168.1.94:55066 accepted //localhost:50053 [direct] 
2020/08/21 10:11:55 192.168.1.94:55068 accepted //localhost:50051 [direct] 
2020/08/21 10:11:59 192.168.1.94:55069 accepted //localhost:50052 [direct] 
2020/08/21 10:12:03 192.168.1.94:55070 accepted //localhost:50053 [direct] 
2020/08/21 10:12:07 192.168.1.94:55071 accepted //localhost:50051 [direct] 
2020/08/21 10:12:11 192.168.1.94:55074 accepted //localhost:50052 [direct] 
2020/08/21 10:12:15 192.168.1.94:55077 accepted //localhost:50053 [direct] 
2020/08/21 10:12:19 192.168.1.94:55078 accepted //localhost:50051 [direct] 
2020/08/21 10:12:23 192.168.1.94:55079 accepted //localhost:50052 [direct] 
2020/08/21 10:12:27 192.168.1.94:55080 accepted //localhost:50053 [direct] 
2020/08/21 10:12:31 192.168.1.94:55081 accepted //localhost:50051 [direct] 
2020/08/21 10:12:35 192.168.1.94:55082 accepted //localhost:50052 [direct] 
2020/08/21 10:12:39 192.168.1.94:55083 accepted //localhost:50053 [direct] 
2020/08/21 10:12:43 192.168.1.94:55085 accepted //localhost:50051 [direct] 
2020/08/21 10:12:47 192.168.1.94:55086 accepted //localhost:50052 [direct] 
2020/08/21 10:12:51 192.168.1.94:55087 accepted //localhost:50053 [direct] 
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

linux 下启动客户端报错x509: certificate signed by unknown authority

log:
v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > v2ray.com/core/proxy/vless/outbound: failed to decode response header > v2ray.com/core/proxy/vless/encoding: failed to read response version > x509: certificate signed by unknown authority

server config:
{ "log": { "loglevel": "warning" }, "inbounds": [ { "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "xxx", // 填写你的 UUID "level": 0, "email": "xxx" } ], "decryption": "none", "fallbacks": [ { "dest": 80 } ] }, "streamSettings": { "network": "tcp", "security": "tls", "tlsSettings": { "alpn": [ "http/1.1" ], "certificates": [ { "certificateFile": "/home/tom/.acme.sh/xxx.cer", // 换成你的证书,绝对路径 "keyFile": "/home/tom/.acme.sh/xxp.key" // 换成你的私钥,绝对路径 } ] } } } ], "outbounds": [ { "protocol": "freedom" } ] }

client config:

{ "log": { "loglevel": "warning" }, "inbounds": [ { "port": 1081, "listen": "127.0.0.1", "protocol": "socks", "settings": { "udp": true } } ], "outbounds": [ { "protocol": "vless", "settings": { "vnext": [ { "address": "xxxx", // 换成你的域名 "port": 443, "users": [ { "id": "xxxx", // 填写你的 UUID "encryption": "none", "level": 0 } ] } ] }, "streamSettings": { "network": "tcp", "security": "tls" } } ] }

同样的配置在windows下是可以的,但是在linux下无法连接服务器v2ray

DNS解析第一个失败的情况下不会尝试第二个

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

  2. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

配置的域名解析,解析vmwarefusion.github.io 失败

查询v2ray的结果

 dig @127.0.0.1 -p 15354 vmwarefusion.github.io

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Debian <<>> @127.0.0.1 -p 15354 vmwarefusion.github.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 31411
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;vmwarefusion.github.io.                IN      A

;; Query time: 4 msec
;; SERVER: 127.0.0.1#15354(127.0.0.1)
;; WHEN: Thu Sep 03 09:55:34 CST 2020
;; MSG SIZE  rcvd: 40

直接查询dns服务器的结果:(status为REFUSED, 即对应日志中rcode=5)

dig @123.123.123.123 vmwarefusion.github.io 

; <<>> DiG 9.11.5-P4-5.1+deb10u2-Debian <<>> @123.123.123.123 vmwarefusion.github.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 25360
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 96941fdbbd1d79bd8be6b0c45f5050db298c8357136261de (good)
;; QUESTION SECTION:
;vmwarefusion.github.io.                IN      A

;; Query time: 4 msec
;; SERVER: 123.123.123.123#53(123.123.123.123)
;; WHEN: Thu Sep 03 10:11:39 CST 2020
;; MSG SIZE  rcvd: 79
  1. 你期待看到的正确表现是怎样的?

按照配置我理解, 当查询第一个dns无返回结果时,应该是不匹配

       "expectIPs": [
          "geoip:cn"
        ]

这个条件的,应该继续往下查询doh。

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

客户端配置:

{
  "log": {
    "loglevel": "info"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 15354,
      "tag": "dns-in",
      "protocol": "dokodemo-door",
      "settings": {
        "address": "1.1.1.1",
        "port": 53,
        "network": "tcp,udp"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "dns",
      "tag": "dns-out"
    },
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    }
  ],
  "dns": {
    "servers": [
      {
        "address": "123.123.123.123",
        "port": 53,
        "domains": [
          "geosite:cn"
        ],
        "expectIPs": [
          "geoip:cn"
        ]
      },
      "https+local://1.1.1.1/dns-query"
    ],
    "clientIp": "123.121.22.1",
    "tag": "dns-inbound"
  },
  "routing": {
    "strategy": "rules",
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "dns-in"
        ],
        "outboundTag": "dns-out"
      },
      {
        "type": "field",
        "inboundTag": [
          "dns-inbound"
        ],
        "outboundTag": "direct"
      }
    ]
  }
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

客户端错误日志:

2020/09/03 09:44:36 [Info] v2ray.com/core/app/dns: DNS: created udp client inited for 123.123.123.123:53                                                                                                                                            
2020/09/03 09:44:36 [Info] v2ray.com/core/app/dns: DNS: created Local DOH client for https://1.1.1.1/dns-query                                                                                                                                      
2020/09/03 09:44:36 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 127.0.0.1:15354                                                                                                                                                  
2020/09/03 09:44:36 [Info] v2ray.com/core/transport/internet/udp: listening UDP on 127.0.0.1:15354                                                                                                                                                  
2020/09/03 09:44:36 [Warning] v2ray.com/core: V2Ray 4.27.5 started                                                                                                                                                                                  
2020/09/03 09:44:57 [Info] [4115359556] v2ray.com/core/proxy/dokodemo: received request for 127.0.0.1:39396                                                                                                                                         
2020/09/03 09:44:57 [Info] [4115359556] v2ray.com/core/app/dispatcher: taking detour [dns-out] for [udp:1.1.1.1:53]                                                                                                                                 
2020/09/03 09:44:57 [Info] [4115359556] v2ray.com/core/proxy/dns: handling DNS traffic to udp:1.1.1.1:53                                                                                                                                            
2020/09/03 09:44:57 127.0.0.1:39396 accepted udp:1.1.1.1:53 [dns-out]                                                                                                                                                                               
2020/09/03 09:44:57 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:123.123.123.123:53                                                                                                                            
2020/09/03 09:44:57 [Info] v2ray.com/core/app/dispatcher: taking detour [direct] for [udp:123.123.123.123:53]                                                                                                                                       
2020/09/03 09:44:57 [Info] v2ray.com/core/proxy/freedom: opening connection to udp:123.123.123.123:53                                                                                                                                               
2020/09/03 09:44:57 [Info] v2ray.com/core/app/dns: UDP:123.123.123.123:53 got answer: vmwarefusion.github.io. TypeA -> [] 4.589518ms                                                                                                                
2020/09/03 09:44:57 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain vmwarefusion.github.io at server UDP:123.123.123.123:53 > rcode: 5                                                                                                
2020/09/03 09:45:05 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled                                                                              
2020/09/03 09:45:05 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > io: read/write on closed pipe                                                                                                                        
2020/09/03 09:45:21 [Info] [4164880411] v2ray.com/core/proxy/dokodemo: received request for 127.0.0.1:40739          

Expose MaxConcurrency and MaxConnection in the config file

Please describe the new feature you want in detail.

I am trying out a browser forwarding solution similar to https://github.com/xiaokangwang/BrowserBridge, which requires that all traffic goes in one single TCP connection.
Ideally, I need to set MaxConnection = 1 and MaxConcurrency = 2**16 in

https://github.com/v2ray/v2ray-core/blob/d8a7763847090b4259b781fbd6d15c6710f2f983/common/mux/client.go#L166

but right now MaxConcurrency is limited to 1024 and MaxConnection is hard-coded.

It would be convenient if they can be configured in the config file.

更新到 4.28.0 後, 客方error.log出现...GODEBUG=x509ignoreCN=0...(已解决)

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    4.28.0

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

golang 1.14.8 
- 用lets encrypt正常
- 用self sign certificate正常

golang 1.15.2
- 用lets encrypt正常
- 用self sign certificate v2client 出现 GODEBUG=x509 ignoreCN=0 error
  1. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
haproxy SSL handshake failure
[12/Sep/2020:07:15:43.898] in-tcp01/1: SSL handshake failure
  1. What's your expectation?
    运作正常

  2. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

        {
            "tag": "in-v2",
            "protocol": "vmess",
            "port": 44304,
            "settings": {
                "clients": [{
                        "id": "UUID",
                        "alterId": 0,
                        "level": 5
                    }
                ]
            },
            "streamsettings": {
                "network": "ws",
                "wsSettings": {
                    "path": "{paht}"
                }
            }
        },

Client configuration:

        {
            "tag": "out-v2",
            "protocol": "vmess",
            "settings": {
                "vnext": [{
                        "address": "{FQDN}",
                        "port": 443,
                        "users": [{
                                "id": "UUID",
                                "alterId": 0,
                                "security": "aes-128-gcm"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "sockopt": {
                    "mark": 255
                },
                "network": "ws",
                "wsSettings": {
                    "path": "/{path}/"
                },
                "security": "tls",
                "tlsSettings": {
                    "allowInsecure": false,
                    "certificates": [{
                            "certificateFile": "user_crt.pem",
                            "keyFile": "user_key.pem"
                        }, {
                            "usage": "verify",
                            "certificateFile": "CA_crt.pem"
                        }
                    ]
                }
            }
        },
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

    // Please attach your server error log here.

Client error log:

2020/09/12 07:17:04 [Warning] [27003027]   v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://{FQDN}/{path}/):  > x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0] > v2ray.com/core/common/retry: all retry attempts failed
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.
  1. Other configurations (such as Nginx) and logs.
    流程: v2client -(tls+ws)-> [internet] -(tls+ws)-> haproxy -(ws)-> v2server

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

使用最新出的v2ray一键安装脚本后没有配置文件,无法进行使用

v2fly/fhs-install-v2ray#61

/etc/v2ray/config.json 和/usr/local/etc/ 目录下也是空的,不存在配置文件

[root@VM-0-16-centos ~]# journalctl --boot -u v2ray
-- Logs begin at Tue 2020-08-18 21:37:28 CST, end at Tue 2020-08-18 22:28:20 CST. --
Aug 18 22:12:12 VM-0-16-centos systemd[1]: Started V2Ray Service.
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: A unified platform for anti-censorship.
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: 2020/08/18 22:12:12 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: 2020/08/18 22:12:12 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl message>
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/00_log.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/01_api.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/02_dns.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/03_routing.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/04_policy.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/05_inbounds.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/06_outbounds.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/07_transport.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/08_stats.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: v2ctl> Read config:  /usr/local/etc/v2ray/09_reverse.json
Aug 18 22:12:12 VM-0-16-centos v2ray[4317]: 2020/08/18 22:12:12 [Warning] v2ray.com/core: V2Ray 4.27.0 started
Aug 18 22:26:21 VM-0-16-centos systemd[1]: Stopping V2Ray Service...
Aug 18 22:26:21 VM-0-16-centos systemd[1]: Stopped V2Ray Service.
[root@VM-0-16-centos ~]# V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ v2ray -test -confdir /usr/local/etc/v2ray/
V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
2020/08/18 22:28:21 Using confdir from arg: /usr/local/etc/v2ray/
Configuration OK.
[root@VM-0-16-centos ~]# ls -alF --color=auto /usr/local/etc/v2ray
total 48
drwxr-xr-x  2 root root 4096 Aug 18 22:09 ./
drwxr-xr-x. 3 root root 4096 Aug 18 22:09 ../
-rw-r--r--  1 root root    3 Aug 18 22:09 00_log.json
-rw-r--r--  1 root root    3 Aug 18 22:09 01_api.json
-rw-r--r--  1 root root    3 Aug 18 22:09 02_dns.json
-rw-r--r--  1 root root    3 Aug 18 22:09 03_routing.json
-rw-r--r--  1 root root    3 Aug 18 22:09 04_policy.json
-rw-r--r--  1 root root    3 Aug 18 22:09 05_inbounds.json
-rw-r--r--  1 root root    3 Aug 18 22:09 06_outbounds.json
-rw-r--r--  1 root root    3 Aug 18 22:09 07_transport.json
-rw-r--r--  1 root root    3 Aug 18 22:09 08_stats.json
-rw-r--r--  1 root root    3 Aug 18 22:09 09_reverse.json
[root@VM-0-16-centos ~]# 

内置DNS使用localhost出现 failed to lookup ip for domain example.com at server localhost > empty response

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

V4.28

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

使用 V2Ray dokodemo-door 协议为其他设备做 DNS 解析服务

  1. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

操作系统使用 Ubuntu18.04

  1. 内置 DNS 仅存在 localhost 时总是出现以下日志,当存在多个 DNS 时基本不会使用 localhost 解析
[Info] v2ray.com/core/app/dns: failed to lookup ip for domain bds.snssdk.com at server localhost > empty response
  1. DNS 分流;Ubuntu 系统自带解析服务,即 127.0.0.53:53,使用命令测试
dig @127.0.0.53 -p 53 www.baidu.com

可得出正常的结果

; <<>> DiG 9.11.3-1ubuntu1.13-Ubuntu <<>> @127.0.0.53 -p 53 www.baidu.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59040
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.baidu.com.			IN	A

;; ANSWER SECTION:
www.baidu.com.		79	IN	CNAME	www.a.shifen.com.
www.a.shifen.com.	24	IN	A	180.101.49.12
www.a.shifen.com.	24	IN	A	180.101.49.11

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sat Sep 12 13:43:14 CST 2020
;; MSG SIZE  rcvd: 101

现在 V2Ray 如下配置则不会使用 127.0.0.53 解析,而是使用 1.1.1.18.8.8.8

    "servers": [
      {
        "address": "127.0.0.53",
        "port": 53,
        "domains": [
          "geosite:cn"
        ],
        "expectIPs": [
          "geoip:cn"
        ]
      },
      "1.1.1.1",
      "8.8.8.8"
    ],

address 填写 114.114.114.114 可以正常查询;

这里我还用 CoreDNS 的上游填写 127.0.0.53:53 ,然后 address 填写 CoreDNS 监听的地址依然有此问题,但是用 dig 测试结果是正常的

日志如下,其中 myserver.com 为我的 VPS IP

2020/09/12 13:45:35 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:myserver.com:443
2020/09/12 13:45:35 [Info] v2ray.com/core/proxy/vmess/outbound: tunneling request to udp:127.0.0.53:53 via tcp:myserver.com:443
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:1.1.1.1:53 > rcode: 3
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:1.1.1.1:53 > rcode: 3
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:1.1.1.1:53 > rcode: 3
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.eu at server UDP:1.1.1.1:53 > rcode: 3
2020/09/12 13:45:35 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:127.0.0.53:53
2020/09/12 13:45:35 [Info] v2ray.com/core/app/dispatcher: default route for udp:127.0.0.53:53
2020/09/12 13:45:35 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:myserver.com:443
2020/09/12 13:45:36 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/12 13:45:36 [Info] v2ray.com/core/proxy/vmess/outbound: tunneling request to udp:127.0.0.53:53 via tcp:myserver.com:443
2020/09/12 13:45:36 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain my.ruanmei.com at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain my.ruanmei.com at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 got answer: my.ruanmei.com. TypeAAAA -> [[2606:4700::6811:7b17] [2606:4700::6811:7a17]] 180.451079ms
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 got answer: my.ruanmei.com. TypeA -> [104.17.122.23 104.17.123.23] 155.348474ms
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.asia at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT grs.dbankcloud.asia -> [] > empty response
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.asia at server UDP:1.1.1.1:53 > empty response
2020/09/12 13:45:36 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:127.0.0.53:53
2020/09/12 13:45:36 [Info] v2ray.com/core/app/dispatcher: default route for udp:127.0.0.53:53
2020/09/12 13:45:36 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:myserver.com:443
2020/09/12 13:45:37 [Info] v2ray.com/core/proxy/vmess/outbound: tunneling request to udp:127.0.0.53:53 via tcp:myserver.com:443
2020/09/12 13:45:37 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain adashbc.ut.taobao.com at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:38 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:127.0.0.53:53
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dispatcher: default route for udp:127.0.0.53:53
2020/09/12 13:45:38 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:myserver.com:443
2020/09/12 13:45:38 [Info] v2ray.com/core/proxy/vmess/outbound: tunneling request to udp:127.0.0.53:53 via tcp:myserver.com:443
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.cn at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT grs.dbankcloud.cn -> [] > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain grs.dbankcloud.cn at server UDP:1.1.1.1:53 > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain bds.snssdk.com at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT bds.snssdk.com -> [] > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain bds.snssdk.com at server UDP:1.1.1.1:53 > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain bds.snssdk.com at server UDP:127.0.0.53:53 > context deadline exceeded
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: UDP:1.1.1.1:53 cache HIT bds.snssdk.com -> [] > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain bds.snssdk.com at server UDP:1.1.1.1:53 > empty response
2020/09/12 13:45:38 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/12 13:45:39 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:127.0.0.53:53
2020/09/12 13:45:39 [Info] v2ray.com/core/app/dispatcher: default route for udp:127.0.0.53:53
2020/09/12 13:45:39 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:myserver.com:443
2020/09/12 13:45:39 [Info] v2ray.com/core/proxy/vmess/outbound: tunneling request to udp:127.0.0.53:53 via tcp:myserver.com:443
2020/09/12 13:45:39 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/12 13:45:39 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > context canceled
  1. 你期待看到的正确表现是怎样的?

可以正常解析并不出现错误

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

客户端配置:

{
  "log": {
    "loglevel": "info",
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log"
  },
  "inbounds": [
    {
      "port": 1080,
      "listen": "127.0.0.1",
      "protocol": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    },
    {
      "port": 853,
      "tag": "dns-in",
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.53",
        "port": 53,
        "network": "tcp,udp",
        "timeout": 10
      },
      "streamSettings": {
        "security": "tls",
        "tlsSettings": {
          "serverName": "myserver.com",
          "allowInsecure": false,
          "alpn": [
            "h2"
          ],
          "certificates": [
            {
              "usage": "encipherment",
              "certificateFile": "/root/.ssl/ss.crt",
              "keyFile": "/root/.ssl/ss.key"
            }
          ]
        },
        "sockopt": {
          "tcpFastOpen": true
        }
      }
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "myserver.com",
            "port": 443,
            "users": [
              {
                "id": "ad46cbaf-d6e2-49f1-8357-ad34cd6551ca",
                "security": "none",
                "level": 0
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": false,
          "disableSessionResumption": true
        },
        "sockopt": {
          "tcpFastOpen": true
        }
      }
    },
    {
      "protocol": "dns",
      "tag": "dns-out"
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "dns-in"
        ],
        "outboundTag": "dns-out"
      },

      {
        "type": "field",
        "ip": [
          "1.1.1.1",
          "8.8.8.8"
        ],
        "outboundTag": "proxy"
      }
    ]
  },
  "dns": {
    "hosts": {
      "geosite:ads": "0.0.0.0"
    },
    "servers": [
      {
        "address": "127.0.0.53",
        "port": 53,
        "domains": [
          "geosite:cn"
        ],
        "expectIPs": [
          "geoip:cn"
        ]
      },
      "1.1.1.1",
      "8.8.8.8"
    ],
  },
  "policy": {
    "levels": {
      "0": {
        "handshake": 4,
        "connIdle": 300,
        "uplinkOnly": 2,
        "downlinkOnly": 5,
        "bufferSize": 40960
      }
    }
  }
}

`sockopt` of Dokodemo TProxy Inbound has no affect on returning socket

你正在使用哪个版本的 V2Ray?

4.26.0

你的使用场景是什么?

透明代理。

你看到的不正常的现象是什么?

用作透明代理的Dokodemo Inbound,其JSON配置中sockopt的设置(e.g. mark)对返回至Client的Socket没有效果。

可以通过如下步骤得到验证:

  1. 配置好透明代理,令所有流量通过Dokodemo Tproxy Inbound,该Inbound设置Sockopt.Mark为255。

  2. 另配置一个Socks Inbound,同样设置Sockopt.Mark为255。

  3. 以DNS查询为例,在透明代理中配置如下日志规则(部分内容)以追踪V2Ray截获后发出的DNS响应:

     ip route add local default dev lo table 100 # 策略路由
     ip rule add fwmark 1 table 100
    
     iptables -t mangle -N V2RAY_INPUT
     iptables -t mangle -A V2RAY_INPUT -p udp --sport 53 -j LOG --log-level info # 记录DNS流量是否被重路由回INPUT链
     iptables -t mangle -A INPUT -j V2RAY_INPUT
    
     iptables -t mangle -N V2RAY_MARK
     iptables -t mangle -A V2RAY_MARK -p udp --sport 53 -j LOG --log-level debug # 记录TProxy的DNS响应(源地址为外网DNS IP:53端口)
     iptables -t mangle -A V2RAY_MARK -p udp -m mark --mark 0xff -j RETURN # 放行V2Ray发出的流量
     iptables -t mangle -A V2RAY_MARK -p udp -j MARK --set-mark 0x1 # 打上标记重路由
     iptables -t mangle -A V2RAY_MARK -p udp --sport 53 -j LOG --log-level debug # 查看是否没有被成功放行
     iptables -t mangle -A OUTPUT -j V2RAY_MARK # 应用至OUTPUT链
  4. 配置好rsyslog服务,执行nslookup baidu.com 114.114.114.114,在/var/log/debug中观察捕获到的DNS流量:

    [2047421.414478] IN= OUT=eth0 SRC=114.114.114.114 DST=127.0.0.1 LEN=80 TOS=0x00 PREC=0x00 TTL=64 ID=32853 DF PROTO=UDP SPT=53 DPT=60862 LEN=60 
    [2047421.414505] IN= OUT=eth0 SRC=114.114.114.114 DST=127.0.0.1 LEN=80 TOS=0x00 PREC=0x00 TTL=64 ID=32853 DF PROTO=UDP SPT=53 DPT=60862 LEN=60 MARK=0x1
    

    在Access日志中可以看到V2Ray成功从外部DNS服务器取得了回复。但上文日志表明Dokodemo Inbound响应的Socket并没有打上255 Mark,也没有成功放行。在/var/log/message中,能看到打上了1 Mark的DNS流量,说明其进入了INPUT链。此时,由于目的地址就是本机,因此nslookup能正常获取到响应

  5. 在另一台设备上,配置114.114.114.114的路由以透明代理设备为网关:

    ip route add 114.114.114.114 via 192.168.200.8 table main # 192.168.200.8是树莓派IP
  6. 在上述设备上以114为服务器查询DNS流量:nslookup baidu.com 114.114.114.114,结果是查询无响应。在透明代理设备的/var/log/debug中能看到与上面相似的两行消息,同时/var/log/messages中显示:

    [1983152.609196] IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=114.114.114.114 DST=192.168.200.7 LEN=254 TOS=0x00 PREC=0x00 TTL=64 ID=19453 DF PROTO=UDP SPT=53 DPT=42598 LEN=234 MARK=0x1
    

    本应直接送回原设备(192.168.200.7)的流量,被重路由后回到了INPUT链(到不了FORWARD链,因为路由表中只配置了送给lo网卡的路由),而透明代理设备并没有能处理该流量的应用,因此包被废弃掉,致使原设备代理失败

  7. 在上述设备上对透明代理设备的Socks Inbound发送任意请求,在/var/log/debug中观察:

    [2116590.850537] IN= OUT=eth0 SRC=192.168.200.8 DST=192.168.200.7 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP SPT=1080 DPT=37666 WINDOW=65160 RES=0x00 ACK SYN URGP=0 MARK=0xff
    

    可以看到Socks Inbound的回复能正常为Socket绑定MARK,同时Client设备能收到回复,说明成功放行。

上述现象的产生,是因为Dokodemo TProxy Inbound并未用监听的Socket回复客户端,而是另外新建了一个源地址绑定为原目标IP的连接(tConn),同时这个连接的Sockopt完全由自己构造,并没有复用StreamSettings里的SocketConfig:

sockopt := &internet.SocketConfig{
Tproxy: internet.SocketConfig_TProxy,
}
if dest.Address.Family().IsIP() {
sockopt.BindAddress = dest.Address.IP()
sockopt.BindPort = uint32(dest.Port)
}
tConn, err := internet.DialSystem(ctx, net.DestinationFromAddr(conn.RemoteAddr()), sockopt)

因此尽管监听Socket成功绑定了Mark 255,回复的Socket与该Mark是无缘的。

你期待看到的正确表现是怎样的?

透明代理的教程里,一个重要的关注点是V2Ray发出的流量应该被直连,而非重路由。同时不仅是V2Ray发给外网的请求,V2Ray回复给内网的响应也是从OUTPUT链上发出流量,从而应当被直连。因此这种对Inbound设置Sockopt的方法同理应像Outbound一样可以生效。

不过,由于在配置透明代理时往往会添加本地IP(如192.168.0.0/16)直连,而Dokodemo TProxy Inbound回复的IP基本在此之列,因此一般情况下不需要设置Sockopt也能达到效果,从而规避了这个问题。
不过×2,由于Socks Inbound的Sockopt设置能够在回复Socket上成功设置MARK,因此Dokodemo的这个行为应当属于BUG,仍然应该被修复。

服务器端配置

"inbounds": [
  {
    "tag":"transparent",
    "protocol": "dokodemo-door",
    "listen": "127.0.0.1",
    "port": 821,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "network": "tcp,udp",
      "followRedirect": true
    },
    "streamSettings": {
      "sockopt": {
        "tproxy": "tproxy", 
        "mark": 255
      }
    }
  }, { 
    "tag": "socks5",
    "protocol": "socks",
    "listen": "192.168.200.8",
    "port": 1080,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "ip": "127.0.0.1",
      "auth": "noauth",
      "udp": true
    },
    "streamSettings": {
      "sockopt": { "mark": 255 }
    }
  }
]

如何降低版本?

服務器端從2.23.4升級到v4.28.2之後,原有的配置文件不起作用,寫了新的配置文件和路徑,徹底重裝了服務器(Debian)也無法順利工作起來,客戶端提示服務拒絕連接connectex: No connection could be made because the target machine actively refused it.] 。三天都找不到解決方法,想回到之前原有的版本,但是舊的安裝脚本提示已作廢,新版的脚本只能安裝最新版本的V2ray,請問如何安裝歷史安裝包?

Shadowsocks user-based routing not working

Version: v4.28.0

I want to proxies shadowsocks into vmess.

Server configuration:

    {
      "port": 1464,
      "listen": "127.0.0.1",
      "protocol": "shadowsocks",
      "settings": {
        "email": "[email protected]",
      }
      {
        "type": "field",
        "user": [
          "[email protected]"
        ],
        "outboundTag": "an-awesome-server"
      }

Journal Logs:

Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/features/routing/session.(*Context).GetUser(0xc000210340, 0xc000085d30, 0xa585bc)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/features/routing/session/context.go:101 +0x11                    
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/router.(*UserMatcher).Apply(0xc00036d620, 0xefd980, 0xc000088840, 0x0)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/router/condition.go:197 +0x35                                
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/router.(*ConditionChan).Apply(0xc00036d600, 0xefd980, 0xc000088840, 0x7fc564d61100)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/router/condition.go:35 +0x79                                 
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/router.(*Rule).Apply(...)                                            
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/router/config.go:65                                          
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/router.(*Router).pickRouteInternal(0xc0001daf00, 0xefda00, 0xc000210340, 0xc000088040, 0xc00021e1e0, 0xc00021a0f0)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/router/router.go:91 +0xd0                                    
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/router.(*Router).PickRoute(0xc0001daf00, 0xefda00, 0xc000210340, 0xc000210340, 0xc000088040, 0x0, 0x0)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/router/router.go:78 +0x45                                    
Sep 11 18:55:45 * v2ray[30175]: v2ray.com/core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0xc0001da6c0, 0xef4ac0, 0xc00021e210, 0xc000210280, 0xef5e40, 0xc00035a610, 0x300210035)
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/dispatcher/default.go:269 +0x3fa                              
Sep 11 18:55:45 * v2ray[30175]: created by v2ray.com/core/app/dispatcher.(*DefaultDispatcher).Dispatch                   
Sep 11 18:55:45 * v2ray[30175]:         v2ray.com/core/app/dispatcher/default.go:207 +0x255     

Proposal for amending domain matching logic

当前V2Ray版本

4.27.0

使用场景

域名匹配(路由、DNS)

看到的不正常的现象是什么?

这个Issue由 v2fly/domain-list-community#91 (comment) 中的现象引出:

我先尝试阅读 V2Ray DNS 部分的源码,看看能不能找出规则处理的优先级的 bug。找到的话,先修优先级 bug,这样通过 DNS 配置就可以避免用 V2Ray 做网关当透明代理时的解析问题。

这个是什么

"dns": {
  "servers": [
    {
      "address": "https+local://dns.alidns.com/dns-query",
      "domains": [
        "geosite:cn",
        "geosite:google@cn",
        "full:fonts.googleapis.com"
      ]
    },
    {
      "address": "https://1.1.1.1/dns-query",
      "domains": [
        "geosite:geolocation-!cn"
      ]
    },
    "223.5.5.5"
  ]
}

由于现在域名 font.googleapis.com 同时在 google@cngeolocation-!cn 中。

当 V2Ray 做网关或者透明代理时,使用上面这样的 DNS 配置,解析 font.googleapis.com 会大概率使用 1.1.1.1,当这个解析失败,才会使用 dns.alidns.com

vless udp 好像有点问题

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)

  4. What's your expectation?

  5. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

    // Please attach your server configuration here.

Client configuration:

    // Please attach your client configuration here.
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

    // Please attach your server error log here.

Client error log:

    // Please attach your client error log here.
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.
  1. Other configurations (such as Nginx) and logs.

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

v2ray反向代理模式存在明显BUG

我简单阐述一下吧,因为我的问题不表现在日志中。(日志无法反映出实际的问题)

v2ray工作模式:反向代理2 (内网A主动连接公网B,C通过A代理访问内网)
v2ray-core版本:刚下载的最新版
运行环境:A ubuntu20.04,B ubuntu20.04,C windows
具体问题:
C多线程下载大文件(100MB以上),中途取消下载并断开C与B的连接,此时内网A依然持续给公网B传输数据(未下载完的那部分数据)。

因此在客户端C断开后, A和B之间持续连接并传输数据,造成大量带宽的占用。导致后续客户端C继续使用连接时,可用带宽不足

我怀疑应该是工作模式上没协调好,B的left跟right的数据接收和转发没有进行有效的关联。当C断开后,没有通知A将C的数据交换队列作废

升级4.28.0,存在反向代理的配置会出错。

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    服务器端的代理、反向代理

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    服务器端的反向代理有问题(在debian下,centos没有)。在存在反向代理配置(我配置了两对反向代理,不知道是否与此有关;配置不变的情况下回滚到之前的版本是正常的)的情况下,v2ray无法连接上代理,status一段时间正常,过会failed。

  4. 你期待看到的正确表现是怎样的?
    恢复正常

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

  6. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。
    除了重启,没有其他异常

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

    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

Test无异常

wless+ws+tls无法正常连接,

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    客户端是透明代理方案

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    无法正常代理

  4. 你期待看到的正确表现是怎样的?

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

服务器端配置:

    // 在这里附上服务器端配置文件
{
        "log":{
                "access":"/var/log/v2ray/access.log",
                        "error":"/var/log/v2ray/error.log",
                        "loglevel":"debug"
        },
                "dns":{
                        "hosts":{
                                "abc.def.ghi:"127.0.0.1"
                        },
                        "servers":[
                        "8.8.8.8",
                        "8.8.4.4",
                        "1.1.1.1"
                        ]
                },
                "policy":{
                        "levels":{
             
                        },
                        "system":{
                                "statsInboundUplink": true,
                                "statsInboundDownlink": true
                        }

                },
                "inbounds":[
                {
                        "port":18975,
                        "listen":"127.0.0.1",
                        "protocol":"vless",
                        "settings":{
                                "clients":[
                                {
                                        "id":"aaaaaaaaaaaaaaaaaaaaaa"
                                }
                                ],
                                "decryption":"none",
                                "fallbacks":[{
                                        //"alpn":"",
                                        //"path":"",
                                        "dest":"abc.def.ghi:443"
                                }]

                        },
                        "steamSettings":{
                                "network":"ws",
                                "wsSettings":{
                                        "path":"/v2ray"
                                },
                                "security": "none"
                        }
                }
        ],"outbounds":[
        {
                "protocol":"freedom",
                        "settings":{}
        }
        ]
}

客户端配置:

    // 在这里附上客户端配置
{
"log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "debug"

  },
"dns": {
      
        "hosts": {
                "abc.def.ghi:443": "1.1.1.1"
        },
        "servers": [
        "208.67.222.222", // 非中**大陆域名使用 Google 的 DNS
        "1.1.1.1", // 非中**大陆域名使用 Cloudflare 的 DNS(备用)
        "114.114.114.114", // 114 的 DNS (备用)
        {
                "address": "223.5.5.5", //**大陆域名使用阿里的 DNS
                "port": 53,
                "domains": [
                        "geosite:cn",
                "ntp.org",  // NTP 服务器
                "abc.def.ghi"
         
                ]
        }
        ]
},
        "stats": {},
        "routing": {
                "domainStrategy": "IPOnDemand",
                "rules": [
                { // 劫持 53 端口 UDP 流量,使用 V2Ray 的 DNS
                        "type": "field",
                        "inboundTag": [
                                "transparent"
                        ],
                        "port": 53,
                        "network": "udp",
                        "outboundTag": "dns-out" 
                },    
                { // 直连 123 端口 UDP 流量(NTP 协议)
                        "type": "field",
                        "inboundTag": [
                                "transparent"
                        ],
                        "port": 123,
                        "network": "udp",
                        "outboundTag": "direct" 
                },    
                {
                        "type": "field", 
                        "ip": [ 
                                // 设置 DNS 配置中的国内 DNS 服务器地址直连,以达到 DNS 分流目的
                                "223.5.5.5",
                        "101.6.6.6",
                        "114.114.114.114"
                        ],
                        "outboundTag": "direct"
                },
                {
                        "type": "field",
                        "ip": [ 
                                // 设置 DNS 配置中的国内 DNS 服务器地址走代理,以达到 DNS 分流目的
                                "208.67.222.222",
                        "8.8.8.8",
                        "1.1.1.1"
                        ],
                        "outboundTag": "proxy" // 改为你自己代理的出站 tag
                },
                { // 广告拦截
                        "type": "field", 
                        "domain": [
                                "geosite:category-ads-all"
                        ],
                        "outboundTag": "blocked"
                },
                { // BT 流量直连
                        "type": "field",
                        "protocol":["bittorrent"], 
                        "outboundTag": "direct"
                },
                        { // 直连**大陆主流网站 ip 和 保留 ip
                                "type": "field", 
                                "ip": [
                                        "geoip:private",
                                "geoip:cn"
                                ],
                                "outboundTag": "direct"
                        },
      { // 直连**大陆主流网站域名
        "type": "field", 
        "domain": [
          "geosite:cn"
        ],
        "outboundTag": "direct"
      },{
        "type":"field",
        "domain":[
          "gc.kis.scr.kaspersky-labs.com",
          "regexp:\\.bilibili.com$",
          "regexp:\\.freebuf.com$",
         "regexp:\\.163.com$",
         "regexp:\\.taobao.com$", 
         "mirrors.ustc.edu.cn",
        "mirrors.tuna.tsinghua.edu.cn$"
        ],
        "outboundTag":"direct"
      }
    ]

  },
  "policy": {},
  "reverse": {},
  "inbounds": [
    {
      "tag":"transparent",
      "port": 4563,
      "protocol": "dokodemo-door",
      "settings": {
        "network": "tcp,udp",
        "followRedirect": true
      },
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "streamSettings": {
        "sockopt": {
          "tproxy": "tproxy" // 透明代理使用 TPROXY 方式
        }
      }
    },
    {
      "port": 1880, 
      "protocol": "socks", // 入口协议为 SOCKS 5
      "sniffing": {
        "enabled": true,
        "destOverride": ["http", "tls"]
      },
      "settings": {
        "auth": "noauth"
      }
    }



  ],
  "outbounds": [
    {
      "tag":"proxy",
      "protocol":"vless",
      "settings":{
        "vnext":[
          {
            "address":"abc.def.ghi",
            "port":443,
            "users":[
              {
                "id":"aaaaaaaaaaaaaaaaaaaaaa",
                "encryption": "none",
                "level": 0
              }
            ]
          }
        ]
      },"mux":{
        "enabled":true,
         "concurrency":8

      },      
      "streamSettings":{
          "network": "ws",
         "WsSettings":{
         "path":"/ggcvay"
          },
        "security": "tls",
        "sockopt": {
          "mark": 255
        }
      }
    },{
      "tag":"direct",
      "protocol": "freedom",
    "settings": {
      "domainStrategy": "UseIP"
    },
    "streamSettings": {
      "sockopt": {
        "mark": 255
      }
    }     
    },
    {
      "tag":"blocked",
      "protocol":"blackhole",
      "settings":{
          "response": {
              "type": "none"
            }
      }
    },
    {
      "tag": "dns-out",
      "protocol": "dns",
      "streamSettings": {
        "sockopt": {
          "mark": 255
        }
      }  
    }



  ],
  "transport": {}
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

    // 在这里附上服务器端日志
2020/09/15 08:13:47 [Info] [2377553241] v2ray.com/core/proxy/vless/inbound: firstLen = 274
2020/09/15 08:13:47 [Info] [2377553241] v2ray.com/core/proxy/vless/inbound: fallback starts > v2ray.com/core/proxy/vless/encoding: invalid request version
2020/09/15 08:13:48 [Info] [2377553241] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: fallback ends > context canceled

客户端错误日志:

    // 在这里附上客户端日志
2020/09/15 23:14:51 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > EOF
2020/09/15 23:14:51 [Debug] v2ray.com/core/app/dns: UDP:1.1.1.1:53 querying DNS for: api.openweathermap.org.
2020/09/15 23:14:51 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/15 23:14:51 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:1.1.1.1:53
2020/09/15 23:14:51 [Info] [547491689] v2ray.com/core/app/dispatcher: sniffed domain: api.openweathermap.org
2020/09/15 23:14:51 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/15 23:14:51 [Debug] v2ray.com/core/app/dns: UDP:1.1.1.1:1111 querying DNS for: api.openweathermap.org.
2020/09/15 23:14:51 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53]
2020/09/15 23:14:51 [Info] v2ray.com/core/common/mux: dispatching request to udp:1.1.1.1:53
2020/09/15 23:14:51 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:1111
2020/09/15 23:14:51 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:1.1.1.1:1111
2020/09/15 23:14:51 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:1111
2020/09/15 23:14:51 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:1111]
2020/09/15 23:14:51 [Info] v2ray.com/core/common/mux: dispatching request to udp:1.1.1.1:1111
2020/09/15 23:14:51 [Debug] [2665918938] v2ray.com/core/proxy/dokodemo: processing connection from: 1.1.1.1:1111
2020/09/15 23:14:51 [Info] [2665918938] v2ray.com/core/proxy/dokodemo: received request for 1.1.1.1:1111
2020/09/15 23:14:51 [Info] [2665918938] v2ray.com/core/app/dispatcher: taking detour [direct] for [tcp:1.1.1.1:1111]
2020/09/15 23:14:51 [Info] [2665918938] v2ray.com/core/proxy/freedom: opening connection to tcp:1.1.1.1:1111
2020/09/15 23:14:51 [Info] [2665918938] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:1.1.1.1:1111
2020/09/15 23:14:52 [Info] [427855149] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/dns: connection ends > context canceled
2020/09/15 23:14:52 [Info] [427855149] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/dokodemo: connection ends > context canceled
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。
    caddy:
    // 在这里附上服务器端日志
{
  "level": "error",
  "ts": 1600183078.746632,
  "logger": "http.log.access.log0",
  "msg": "handled request",
  "request": {
    "method": "GET",
    "uri": "/ggcvay",
    "proto": "HTTP/1.1",
    "remote_addr": "110.110.110.110",
    "host": "abc.def.ghi",
    "headers": {
      "User-Agent": [
        "Go-http-client/1.1"
      ],
      "Connection": [
        "Upgrade"
      ],
      "Sec-Websocket-Key": [
        "cs1jq+lTxiKFVSwbAppHDA=="
      ],
      "Sec-Websocket-Version": [
        "13"
      ],
      "Upgrade": [
        "websocket"
      ]
    },
    "tls": {
      "resumed": true,
      "version": 772,
      "ciphersuite": 4865,
      "proto": "http/1.1",
      "proto_mutual": true,
      "server_name": "abc.def.ghi"
    }
  },
  "common_log": "110.110.110.110 - - [15/Sep/2020:08:17:58 -0700] \"GET /v2ray HTTP/1.1\" 400 48",
  "duration": 1.003963482,
  "size": 48,
  "status": 400,
  "resp_headers": {
    "Server": [
      "Caddy"
    ]
  }
}
  1. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

开启 sniffing 后,MTG FakeTLS 将无法使用

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

v4.26.0

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

手机通过 vmess+tls 连接 9seconds 的 MTG 使用 Telegram。

  1. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

    9seconds 的 MTG 开启 FakeTLS,并将 FakeTLS 设置为 bing.com。
    V2ray 服务器端启用 sniffing。
    打开代理工具连接到 V2ray 服务器端后,Telegram 将无法正常连接到该 MTG 代理服务器,且 MTG 代理服务器端收不到 Telegram 发来的任何数据。

  2. 你期待看到的正确表现是怎样的?

MTG 数据可通过 V2ray 传输。但从错误日志来看,像是 V2ray 把 MTG 的数据发给了 bing.com 而不是 MTG 服务器端?如果不开 sniffing,MTG 是可以正常经过 V2ray 连上的。

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

服务器端配置:

    // 在这里附上服务器端配置文件
    {
  "log": {
    "access": "access.log",
    "error": "error.log",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 1111,
      "listen": "0.0.0.0",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "31859220-2bd4-54ac-ab18-fb297a951680",
            "alterId": 2
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "tls",
        "tlsSettings": {
          "certificates": [
            {
              "certificateFile": "/etc/v2ray/server.crt",
              "keyFile": "/etc/v2ray/server.key"
            }
          ]
        }
      },
      "tag": "",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "rules": [
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  }
}

客户端配置:

    // 在这里附上客户端配置
    不重要
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

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

2020/07/22 21:53:09 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:1111
2020/07/22 21:53:09 [Warning] v2ray.com/core: V2Ray 4.26.0 started
2020/07/22 21:53:10 [Info] [902122793] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443
2020/07/22 21:53:10 [Info] [902122793] v2ray.com/core/app/dispatcher: sniffed domain: bing.com
2020/07/22 21:53:10 [Info] [902122793] v2ray.com/core/app/dispatcher: default route for tcp:bing.com:443
2020/07/22 21:53:10 [Info] [902122793] v2ray.com/core/proxy/freedom: opening connection to tcp:bing.com:443
2020/07/22 21:53:10 [Info] [902122793] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:bing.com:443
2020/07/22 21:53:10 [Info] [2286644073] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443
2020/07/22 21:53:10 [Info] [2286644073] v2ray.com/core/app/dispatcher: sniffed domain: bing.com
2020/07/22 21:53:10 [Info] [2286644073] v2ray.com/core/app/dispatcher: default route for tcp:bing.com:443
2020/07/22 21:53:10 [Info] [2286644073] v2ray.com/core/proxy/freedom: opening connection to tcp:bing.com:443
2020/07/22 21:53:10 [Info] [2286644073] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3232294754] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443
2020/07/22 21:53:17 [Info] [3232294754] v2ray.com/core/app/dispatcher: sniffed domain: bing.com
2020/07/22 21:53:17 [Info] [3232294754] v2ray.com/core/app/dispatcher: default route for tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3232294754] v2ray.com/core/proxy/freedom: opening connection to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3232294754] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3762363108] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443
2020/07/22 21:53:17 [Info] [3762363108] v2ray.com/core/app/dispatcher: sniffed domain: bing.com
2020/07/22 21:53:17 [Info] [3762363108] v2ray.com/core/app/dispatcher: default route for tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3762363108] v2ray.com/core/proxy/freedom: opening connection to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [3762363108] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [4025568090] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443
2020/07/22 21:53:17 [Info] [4025568090] v2ray.com/core/app/dispatcher: sniffed domain: bing.com
2020/07/22 21:53:17 [Info] [4025568090] v2ray.com/core/app/dispatcher: default route for tcp:bing.com:443
2020/07/22 21:53:17 [Info] [4025568090] v2ray.com/core/proxy/freedom: opening connection to tcp:bing.com:443
2020/07/22 21:53:17 [Info] [4025568090] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:bing.com:443
2020/07/22 21:53:22 [Info] [22665937] v2ray.com/core/proxy/vmess/inbound: received request for tcp:172.105.*.*:443

客户端错误日志:

    // 在这里附上客户端日志
    不重要
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志

2020/07/22 21:53:10 120.15.*.*:62086 accepted tcp:172.105.*.*:443
2020/07/22 21:53:10 120.15.*.*:62087 accepted tcp:172.105.*.*:443
2020/07/22 21:53:17 120.15.*.*:62091 accepted tcp:172.105.*.*:443
2020/07/22 21:53:17 120.15.*.*:62092 accepted tcp:172.105.*.*:443
2020/07/22 21:53:17 120.15.*.*:62093 accepted tcp:172.105.*.*:443
2020/07/22 21:53:22 120.15.*.*:62097 accepted tcp:172.105.*.*:443
  1. 其它相关的配置文件(如 Nginx)和相关日志。

MTG 启动命令:

./mtg run -b 0.0.0.0:443 ee6792a48f01b8a87cd757170e00493cd262696e672e636f6d -d

MTG 仓库:https://github.com/9seconds/mtg

  1. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

升级4.28.1内核后部分线路无法联网

PC端v2rayN 3.23版本 内核4.28.1出现部分线路无法联网的情况
线路为非443端口,tcp传输协议。无法联网
但是,此线路在手机端正常联网。
443端口和ws协议的线路可正常上网。
把内核降为4.27.5后,线路可正常联网。

你们arm64包改名了,要更新

https://github.com/v2fly/v2ray-core/releases/download/v4.27.0/v2ray-linux-arm64.zip这个包被你们改名了,导致更新失败.
root@pizero5:~# ./go.sh -p http://192.168.193.76:2080
Installing V2Ray v4.27.0 on aarch64
Downloading V2Ray: https://github.com/v2fly/v2ray-core/releases/download/v4.27.0/v2ray-linux-arm64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 1 0 0:00:09 0:00:05 0:00:04 2
awk: not an option: -e
[/tmp/v2ray/v2ray.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Shutting down V2Ray service.
Archive: /tmp/v2ray/v2ray.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/v2ray/v2ray.zip or
/tmp/v2ray/v2ray.zip.zip, and cannot find /tmp/v2ray/v2ray.zip.ZIP, period.
Failed to copy V2Ray binary and resources.

无法连接到远程服务器

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    使用火狐游览器

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    PC客户端显示,当前服务的真连接延迟: -1ms,虽然pc端无法连接但是安卓端可以正常的连接。

  4. 你期待看到的正确表现是怎样的?
    延迟显示为正数

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

服务器端配置:

   
{
  "log": {
    "loglevel": "info",
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log"
  },
  "inbounds": [{
    "port": 17541,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "118.xxx.xxx.xxx",
          "level": 1,
          "alterId": 0
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/user/infor/skuk",
        "headers": {
          "Host": "server.tk"
        }
      

客户端配置:

    // 在这里附上客户端配置
{
  "policy": null,
  "log": {
    "access": "D:\\v2ray\\v2rayN-Core\\Vaccess.log",
    "error": "D:\\v2ray\\v2rayN-Core\\Verror.log",
    "loglevel": "error"
  },
  "inbounds": [
    {
      "tag": "proxy",
      "port": 8088,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "auth": "noauth",
        "udp": true,
        "ip": null,
        "address": null,
        "clients": null
      },
      "streamSettings": null
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "118.xxx.xxx.xxx",
            "port": 443,
            "users": [
              {
                "id": "id",
                "alterId": 0,
                "email": "[email protected]",
                "security": "auto"
              }
            ]
          }
        ],
        "servers": null,
        "response": null
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": true,
          "serverName": "server.tk"
        },
        "tcpSettings": null,
        "kcpSettings": null,
        "wsSettings": {
          "connectionReuse": true,
          "path": "/user/infor/skuk",
          "headers": {
            "Host": "server.tk"
          }
        },
        "httpSettings": null,
        "quicSettings": null
      },
      "mux": {
        "enabled": true,
        "concurrency": 8
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": null
      },
      "streamSettings": null,
      "mux": null
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": {
          "type": "http"
        }
      },
      "streamSettings": null,
      "mux": null
    }
  ],
  "stats": null,
  "api": null,
  "dns": null,
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "port": null,
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "ip": null,
        "domain": null
      }
    ]
  }
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

    // 在这里附上服务器端日志
2020/09/21 13:45:54 [Info] [2785426049] v2ray.com/core/proxy/vmess/inbound: received request for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2785426049] v2ray.com/core/app/dispatcher: default route for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2785426049] v2ray.com/core/proxy/freedom: opening connection to udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2212618537] v2ray.com/core/proxy/vmess/inbound: received request for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2212618537] v2ray.com/core/app/dispatcher: default route for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2212618537] v2ray.com/core/proxy/freedom: opening connection to udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [591753564] v2ray.com/core/proxy/vmess/inbound: received request for udp:239.255.255.250:1900
2020/09/21 13:45:54 [Info] [591753564] v2ray.com/core/app/dispatcher: taking detour [blocked] for [udp:239.255.255.250:1900]
2020/09/21 13:45:54 [Info] [591753564] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vmess/inbound: connection ends > io: read/write on closed pipe
2020/09/21 13:45:54 [Info] [2723671215] v2ray.com/core/proxy/vmess/inbound: received request for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2723671215] v2ray.com/core/app/dispatcher: default route for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [2723671215] v2ray.com/core/proxy/freedom: opening connection to udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [1349095058] v2ray.com/core/proxy/vmess/inbound: received request for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [1349095058] v2ray.com/core/app/dispatcher: default route for udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [1349095058] v2ray.com/core/proxy/freedom: opening connection to udp:1.1.1.1:53
2020/09/21 13:45:54 [Info] [3270135845] v2ray.com/core/proxy/vmess/inbound: received request for tcp:app.adjust.com:443
2020/09/21 13:45:54 [Info] [3270135845] v2ray.com/core/app/dispatcher: default route for tcp:app.adjust.com:443
2020/09/21 13:45:54 [Info] [3270135845] v2ray.com/core/proxy/freedom: opening connection to tcp:app.adjust.com:443
2020/09/21 13:45:54 [Info] [3270135845] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:app.adjust.com:443
2020/09/21 13:45:54 [Info] [3454903683] v2ray.com/core/proxy/vmess/inbound: received request for tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:54 [Info] [3454903683] v2ray.com/core/app/dispatcher: default route for tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:54 [Info] [3454903683] v2ray.com/core/proxy/freedom: opening connection to tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:54 [Info] [3454903683] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:55 [Info] [2824662738] v2ray.com/core/proxy/vmess/inbound: received request for tcp:api.leanplum.com:443
2020/09/21 13:45:55 [Info] [2824662738] v2ray.com/core/app/dispatcher: default route for tcp:api.leanplum.com:443
2020/09/21 13:45:55 [Info] [2824662738] v2ray.com/core/proxy/freedom: opening connection to tcp:api.leanplum.com:443

客户端错误日志:

     --------------------------------无法连接到远程服务器[13:45:44]--------------------------------
System.Net.WebException: 无法连接到远程服务器 ---> System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:8089
    System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- 内部异常堆栈跟踪的结尾 ---
    System.Net.HttpWebRequest.GetResponse()
    v2rayN.Handler.SpeedtestHandler.GetRealPingTime(String url, WebProxy webProxy, Int32& responseTime)
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
2020/09/21 13:45:54 14.119.187.208:50200 accepted udp:1.1.1.1:53
2020/09/21 13:45:54 14.119.187.208:50202 accepted udp:1.1.1.1:53
2020/09/21 13:45:54 14.119.187.208:50204 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:54 14.119.187.208:50206 accepted udp:1.1.1.1:53
2020/09/21 13:45:54 14.119.187.208:50208 accepted udp:1.1.1.1:53
2020/09/21 13:45:54 14.119.187.208:50210 accepted tcp:app.adjust.com:443
2020/09/21 13:45:54 14.119.187.208:50212 accepted tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:55 14.119.187.208:50220 accepted tcp:api.leanplum.com:443
2020/09/21 13:45:55 14.119.187.208:50224 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:56 14.119.187.208:50226 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:56 14.119.187.208:50228 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:57 14.119.187.208:50230 accepted tcp:incoming.telemetry.mozilla.org:443
2020/09/21 13:45:57 14.119.187.208:50236 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:58 14.119.187.208:50238 accepted udp:1.1.1.1:53
2020/09/21 13:45:58 14.119.187.208:50240 accepted udp:1.1.1.1:53
2020/09/21 13:45:58 14.119.187.208:50242 accepted udp:1.1.1.1:53
2020/09/21 13:45:58 14.119.187.208:50244 accepted udp:1.1.1.1:53
2020/09/21 13:45:58 14.119.187.208:50246 accepted tcp:www.google.com:443
2020/09/21 13:45:58 14.119.187.208:50250 accepted tcp:encrypted-tbn0.gstatic.com:443
2020/09/21 13:45:58 14.119.187.208:50254 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:45:59 14.119.187.208:50256 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:46:00 14.119.187.208:50258 accepted udp:1.1.1.1:53
2020/09/21 13:46:00 14.119.187.208:50260 accepted tcp:avatars3.githubusercontent.com:443
2020/09/21 13:46:00 14.119.187.208:50264 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:46:00 14.119.187.208:50266 accepted udp:239.255.255.250:1900 [blocked]
2020/09/21 13:46:01 14.119.187.208:50268 accepted udp:1.1.1.1:53
2020/09/21 13:46:01 14.119.187.208:50270 accepted udp:1.1.1.1:53
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

使用DOH方式查询DNS,并且DOH服务器经过代理,当有并发DNS查询请求时,第一个DNS查询请求返回结果后,其余DNS查询请求均会失败。

  1. 你正在使用哪个版本的 V2Ray?
    4.27.4

  2. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    使用DOH方式查询DNS,并且DOH服务器经过代理,当有并发DNS查询请求时,第一个DNS查询请求返回结果后,其余DNS查询请求均会失败。

测试了以下方式不会有此错误:
使用DOH方式查询DNS,并且DOH服务器经过代理,无并发DNS查询请求
使用DOH方式查询DNS,DOH服务器直连模式(https+local:)
使用UDP方式查询DNS

  1. 你期待看到的正确表现是怎样的?
    使用DOH方式查询DNS,并且DOH服务器经过代理,当有并发DNS查询请求时,所有DNS查询请求均能成功完成。

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

略去了一些无关配置,
此配置进入dns-in的dns查询请求会经过路由dns-out,然后使用内置dns服务器查询dns,
内置DNS服务器是https://1.1.1.1/dns-query 非直连模式(直连模式不会有错误),目前非直连DOH服务器无视路由规则,直接走第一个outbound到服务器端,由服务端查询dns请求并返回结果(服务器为正常翻墙配置)

客户端配置:

  "dns": {
    "servers": [
      {
        "address": "https://1.1.1.1/dns-query",
        "port": 53
      }
    ]
  },
  "inbounds": [
    {
      "port": 53,
      "listen": "0.0.0.0",
      "tag": "dns-in",
      "protocol": "dokodemo-door",
      "settings": {
        "network": "tcp,udp",
        "address": "8.8.8.8",
        "port": 53,
        "timeout": 300,
        "followRedirect": false,
        "userLevel": 0
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "代理IP",
            "port": 443,
            "users": [
              {
                "id": "UUID",
                "alterId": 0,
                "encryption": "none",
              }
            ]
          }
        ]
      },
      "tag": "proxy",
      "streamSettings": {
        "network": "tcp",
        "security": "tls",
        "tlsSettings": {
          "serverName": "xxx.com",
          "allowInsecure": false
        }
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    }
  ],
  "rules": [
      {
        "type": "field",
        "inboundTag": [
          "dns-in"
        ],
        "outboundTag": "dns-out"
      }
    ]
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

(无并发时不会有错误)
当有并发dns查询请求时,典型的错误log如下,貌似第一个DNS查询请求完成时,导致了其他未完成的DNS查询请求直接失败。

2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 querying: github.com.
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [tcp:1.1.1.1:443]
2020/08/31 17:54:21 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:代理ip:443
2020/08/31 17:54:21 [Debug] [2537953682] v2ray.com/core/proxy/dokodemo: processing connection from: 127.0.0.1:17580
2020/08/31 17:54:21 [Info] [2537953682] v2ray.com/core/proxy/dokodemo: received request for 127.0.0.1:17580
2020/08/31 17:54:21 [Info] [2537953682] v2ray.com/core/app/dispatcher: taking detour [dns-out] for [udp:8.8.8.8:53]
2020/08/31 17:54:21 [Info] [2537953682] v2ray.com/core/proxy/dns: handling DNS traffic to udp:8.8.8.8:53
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 querying: github.com.
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [tcp:1.1.1.1:443]
2020/08/31 17:54:21 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:代理ip:443
2020/08/31 17:54:21 [Debug] [701371869] v2ray.com/core/proxy/dokodemo: processing connection from: 127.0.0.1:7662
2020/08/31 17:54:21 [Info] [701371869] v2ray.com/core/proxy/dokodemo: received request for 127.0.0.1:7662
2020/08/31 17:54:21 [Info] [701371869] v2ray.com/core/app/dispatcher: taking detour [dns-out] for [udp:8.8.8.8:53]
2020/08/31 17:54:21 [Info] [701371869] v2ray.com/core/proxy/dns: handling DNS traffic to udp:8.8.8.8:53
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 querying: github.githubassets.com.
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [tcp:1.1.1.1:443]
2020/08/31 17:54:21 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:代理ip:443
2020/08/31 17:54:21 [Debug] [967603878] v2ray.com/core/proxy/dokodemo: processing connection from: 127.0.0.1:9044
2020/08/31 17:54:21 [Info] [967603878] v2ray.com/core/proxy/dokodemo: received request for 127.0.0.1:9044
2020/08/31 17:54:21 [Info] [967603878] v2ray.com/core/app/dispatcher: taking detour [dns-out] for [udp:8.8.8.8:53]
2020/08/31 17:54:21 [Info] [967603878] v2ray.com/core/proxy/dns: handling DNS traffic to udp:8.8.8.8:53
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 querying: github.githubassets.com.
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dispatcher: taking detour [proxy] for [tcp:1.1.1.1:443]
2020/08/31 17:54:21 [Info] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:代理ip:443
2020/08/31 17:54:21 [Info] v2ray.com/core/proxy/vless/outbound: tunneling request to tcp:1.1.1.1:443 via tcp:代理ip:443
2020/08/31 17:54:21 [Info] v2ray.com/core/proxy/vless/outbound: tunneling request to tcp:1.1.1.1:443 via tcp:代理ip:443
2020/08/31 17:54:21 [Info] v2ray.com/core/proxy/vless/outbound: tunneling request to tcp:1.1.1.1:443 via tcp:代理ip:443
2020/08/31 17:54:21 [Info] v2ray.com/core/proxy/vless/outbound: tunneling request to tcp:1.1.1.1:443 via tcp:代理ip:443
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 got answer: github.githubassets.com. TypeA -> [185.199.110.154 185.199.111.154 185.199.109.154 185.199.108.154] 203.073371ms
2020/08/31 17:54:21 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > context canceled
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: DOH//1.1.1.1 got answer: github.githubassets.com. TypeAAAA -> [] 203.179089ms
2020/08/31 17:54:21 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > context canceled
2020/08/31 17:54:21 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain github.githubassets.com at server DOH//1.1.1.1 > empty response
2020/08/31 17:54:21 [Error] v2ray.com/core/app/dns: failed to retrieve response for github.com. > Post "https://1.1.1.1/dns-query": io: read/write on closed pipe
2020/08/31 17:54:21 [Error] v2ray.com/core/app/dns: failed to retrieve response for github.com. > Post "https://1.1.1.1/dns-query": io: read/write on closed pipe
2020/08/31 17:54:21 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > context canceled
2020/08/31 17:54:21 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > context canceled

Inbound config without `sockopt` will block inbound listener from setting `SO_REUSEPORT`

你正在使用哪个版本的 V2Ray?

4.26.0。

你的使用场景是什么?

透明代理。

你看到的不正常的现象是什么?

当Inbound的JSON配置中,若sockopt一项没有设置的话,会导致Inbound服务器的监听socket的SO_REUSEPORT不被设置。

这可以在Inbound设置SO_REUSEPORT的代码中:

if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {
return newError("failed to set SO_REUSEPORT").Base(err).AtWarning()
}

通过GetSockopt在日志中追加打印SO_REUSEPORT的值来验证:

if value, err := syscall.GetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT); err == nil {
	newError("Reuseport: " + strconv.Itoa(value)).AtWarning().WriteToLog()
}

验证结果如下:

[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:53
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:53
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3423
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3423
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3424
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:36106
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:36106
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:32758
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:32758
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:821
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:821
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 192.168.200.8:1080
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 192.168.200.8:1080
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:8123
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3421
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:3421
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3422
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3422
[Warning] v2ray.com/core: V2Ray 4.25.1 started

根据下文配置可以看到,821、1080、3421、32758、36106(30000-40000端口范围)端口对应的Inbound设置了sockopt,它们也打印了相应的Reuseport输出,而剩余未设置sockopt的Inbound全部未打印。

这也导致了尽管v2ray/v2ray-core#2228 为Inbound引入了SO_REUSEPORT能力,但依然不能修复v2ray/v2ray-core#1971 中的failed to bind source address问题,因为没有为dokodemo-door inbound写sockopt时,Socket 0.0.0.0:53SO_REUSEPORT完全无缘。

你期待看到的正确表现是怎样的?

正确改动后,应该会有如下输出:

[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:821
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:821
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:8123
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:53
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:53
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3421
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:3421
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3422
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3422
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 192.168.200.8:1080
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 192.168.200.8:1080
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3423
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:3423
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:3424
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:36613
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:36613
[Warning] v2ray.com/core/transport/internet: Reuseport: 1
[Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:32783
[Info] v2ray.com/core/transport/internet/kcp: listening on 0.0.0.0:32783
[Warning] v2ray.com/core: V2Ray 4.25.1 started

除了KCP监听外,TCP与UDP监听均成功设置了SO_REUSEPORT(并没有去研究KCP是否应与这个选项搭上关系……)。

在本地运行https://rextester.com/BUAFK86204 中的测试代码,可以看到其他Socket能够正常绑定53端口了:

Test port is 53...
Primary address: 192.168.200.8...
(none)     UDP    Port(2)    0.0.0.0          0.0.0.0          ->  OK
(none)     UDP    Port(2)    0.0.0.0          127.0.0.1        ->  OK
(none)     UDP    Port(2)    0.0.0.0          192.168.200.8    ->  OK
(none)     UDP    Port(2)    127.0.0.1        0.0.0.0          ->  OK
(none)     UDP    Port(2)    127.0.0.1        127.0.0.1        ->  OK
(none)     UDP    Port(2)    127.0.0.1        192.168.200.8    ->  OK
(none)     UDP    Port(2)    192.168.200.8    0.0.0.0          ->  OK
(none)     UDP    Port(2)    192.168.200.8    127.0.0.1        ->  OK
(none)     UDP    Port(2)    192.168.200.8    192.168.200.8    ->  OK
$ netstat -nap | grep :53
tcp6       0      0 :::53                  :::*                    LISTEN      348552/v2ray        
udp        0      0 192.168.200.8:53       0.0.0.0:*                           348569/./sock_reuse 
udp        0      0 0.0.0.0:53             0.0.0.0:*                           348569/./sock_reuse 
udp6       0      0 :::53                  :::*                                348552/v2ray 

服务器端配置:

"inbounds": [
  { 
    "tag":"transparent",
    "protocol": "dokodemo-door",
    "port": 821,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "network": "tcp,udp",
      "followRedirect": true
    },
    "streamSettings": {
      "sockopt": {
        "tproxy": "tproxy"
      }
    }
  }, {
    "tag": "socks5",
    "protocol": "socks",
    "port": 1080,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "ip": "127.0.0.1",
      "auth": "noauth",
      "udp": true
    },
    "streamSettings": {
      "sockopt": { "mark": 255 }
    }
  }, { 
    "tag": "http",
    "protocol": "http",
    "port": 8123,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "timeout": 0
    }
  }, {
    "tag": "dns-in",
    "protocol": "dokodemo-door",
    "port": 53,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "address": "127.0.0.53",
      "port": 53,
      "network": "tcp,udp"
    }
  }, {
    "tag": "mkcp-remote",
    "protocol": "vmess",
    "port": 3421,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "streamSettings": {
      "network": "mkcp",
      "sockopt": { "tcpFastOpen": true },
      "kcpSettings": {
        "uplinkCapacity": 100,
        "downlinkCapacity": 100,
        "congestion": true,
        "header": { "type": "utp" }
      }
    },
    "settings": {
      "detour": { "to": "vmess-dynamic" },
      "clients": []
    }
  }, {
    "tag": "ss-remote",
    "protocol": "shadowsocks",
    "port": 3422,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "method": "aes-256-cfb",
      "network": "tcp,udp",
      "email": "",
      "password": ""
    }
  }, {
    "tag": "socks5-remote",
    "protocol": "socks",
    "port": 3423,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "auth": "password",
      "accounts": [{
        "user": "",
        "pass": ""
      }],
      "ip": "127.0.0.1",
      "udp": true
    }
  }, {
    "tag": "http-remote",
    "protocol": "http",
    "port": 3424,
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "accounts": [{
        "user": "",
        "pass": ""
      }]
    }
  }, {
    "tag": "vmess-dynamic",
    "protocol": "vmess",
    "port": "30000-40000",
    "allocate": {
      "strategy": "random",
      "concurrency": 2,
      "refresh": 3
    },
    "streamSettings": {
      "network": "mkcp",
      "sockOpt": { "tcpFastOpen": true },
      "kcpSettings": {
        "uplinkCapacity": 100,
        "downlinkCapacity": 100,
        "congestion": true,
        "header": { "type": "utp" }
      }
    },
    "sniffing": { "enabled": true, "destOverride": ["http", "tls"] },
    "settings": {
      "default": { "level": 2, "alterId": 64 }
    }
  }
],

vless不回落而直接reject connection

Server v2ray version: v4.27.4

Server config:

{
    "log": {
	     "access": "/var/log/alex.log",
             "error": "/var/log/alex.log",
             "loglevel": "debug"
    },
    "inbounds": [
        {
            "listen": "0.0.0.0",
            "port": 443,
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "50332244-16a4-4728-a1c2-da5b81ddc28c",
                        "level": 0,
                        "email": "[email protected]"
                    }
                ],
                "decryption": "none",
                "fallbacks": [
                    {
                        "dest": 80
                    }
		]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "tls",
                "tlsSettings": {
                    "alpn": [
                        "http/1.1"
                    ],
                    "certificates": [
                        {
                            "certificateFile": "/ssl/cc.crt",
                            "keyFile": "/ssl/cc.key"
                        }
                    ]
                }
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "tag": "direct"
        }
    ]
}

nginx config:

    server {
        listen 0.0.0.0:80;

        charset utf-8;

        access_log /var/log/nginx/access.log main;

        location / {
            root /usr/share/nginx/html;
        }

        error_page  404              /404.html;

        error_page 500 502 503 504 /50x.html;
    }

Serve Debug log:
2020/08/31 15:35:26 [Info] [4167277421] v2ray.com/core/proxy/vless/inbound: firstLen = 527
2020/08/31 15:35:26 129.226.189.243:24651 rejected v2ray.com/core/proxy/vless/encoding: invalid request version
2020/08/31 15:35:26 [Warning] [4167277421] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: invalid request from 129.226.189.243:24651 > v2ray.com/core/proxy/vless/encoding: invalid request version
2020/08/31 15:35:27 129.226.189.243:33422 rejected v2ray.com/core/proxy/vless/encoding: invalid request version
2020/08/31 15:35:27 [Info] [1022286226] v2ray.com/core/proxy/vless/inbound: firstLen = 539
2020/08/31 15:35:27 [Warning] [1022286226] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: invalid request from 129.226.189.243:33422 > v2ray.com/core/proxy/vless/encoding: invalid request version
2020/08/31 15:35:32 129.226.189.243:12138 rejected v2ray.com/core/proxy/vless/encoding: invalid request version
2020/08/31 15:35:32 [Info] [1627545069] v2ray.com/core/proxy/vless/inbound: firstLen = 539
2020/08/31 15:35:32 [Warning] [1627545069] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: invalid request from 129.226.189.243:12138 > v2ray.com/core/proxy/vless/encoding: invalid request version

直接web访问服务器80端口可以访问index.html, 通过服务器443端口https访问不了index.html
请问哪里没配对导致不回落呢?

vless udp 好像有点问题

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    v4.27.0

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    microsoft remote desktop

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
    vmess:3389tcp+udp可正常运作, vless:只可3389tcp.
    good01

3389udp vless有error.
error01

  1. What's your expectation?
    3389udp vLess可正常运作.

  2. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

        // server-inbounds-vmess
        {
            "protocol": "vmess",
            "port": 44391,
            "settings": {
                "clients": [{
                        "id": "UUID",
                        "alterId": 64
                    }
                ]
            },
            "streamSettings": {
                "network": "h2",
                "httpSettings": {
                    "host": "{fqdn}",
                    "path": "/path/"
                },
                "security": "none"
            }
        },

        // server-inbounds-vless
        {
            "protocol": "vless",
            "port": 44392,
            "settings": {
                "clients": [{
                        "id": "UUID"
                    }
                ],
                "decryption": "none"
            },
            "streamsettings": {
                "network": "h2",
                "httpSettings": {
                    "host": "{fqdn}",
                    "path": "/path/"
                },
                "security": "none"
            }
        },

Client configuration:

        // "tag": "out-vless_h2"
        {
            "tag": "out-vless_h2",
            "protocol": "vless",
            "settings": {
                "vnext": [{
                        "address": "fqdn",
                        "port": 443,
                        "users": [{
                                "UUID",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "h2",
                "httpSettings": {
                    "host": "fqdn",
                    "path": "/path/"
                },
                "security": "tls",
                "tlsSettings": {
                    "allowInsecure": false
                }
            }
        },


        //out-vmess_h2
        {
            "tag": "out-vmess_h2",
            "protocol": "vmess",
            "settings": {
                "vnext": [{
                        "address": "fqdn",
                        "port": 443,
                        "users": [{
                                "id": "UUID",
                                "alterId": 64,
                                "security": "aes-128-gcm",
                                "testsEnabled": "VMessAEAD"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "h2",
                "httpSettings": {
                    "host": "fqdn",
                    "path": "/path/"
                },
                "security": "tls",
                "tlsSettings": {
                    "allowInsecure": false
                }
            }
        },
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

=== [[[ vless ]===

2020/08/24 12:38:21 [Info] [1739102002] v2ray.com/core/proxy/vless/inbound: received request for tcp:192.168.1.1:3389
2020/08/24 12:38:21 [Info] [1739102002] v2ray.com/core/app/dispatcher: taking detour [out-direct] for [tcp:192.168.1.1:3389]
2020/08/24 12:38:21 [Info] [1739102002] v2ray.com/core/proxy/freedom: opening connection to tcp:192.168.1.1:3389
2020/08/24 12:38:21 [Info] [1739102002] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:192.168.1.1:3389
2020/08/24 12:38:25 [Info] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled
2020/08/24 12:38:25 [Info] v2ray.com/core/transport/internet/udp: failed to handle UDP input > io: read/write on closed pipe

2020/08/24 12:38:25 [Info] [3906587314] v2ray.com/core/proxy/vless/inbound: firstLen = 73
2020/08/24 12:38:25 [Info] [3906587314] v2ray.com/core/proxy/vless/inbound: received request for tcp:192.168.1.1:3389
2020/08/24 12:38:25 [Info] [3906587314] v2ray.com/core/app/dispatcher: taking detour [out-direct] for [tcp:192.168.1.1:3389]
2020/08/24 12:38:25 [Info] [3906587314] v2ray.com/core/proxy/freedom: opening connection to tcp:192.168.1.1:3389
2020/08/24 12:38:25 [Info] [3906587314] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:192.168.1.1:3389

2020/08/24 12:38:25 [Info] [1739102002] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: connection ends > context canceled
2020/08/24 12:38:25 [Info] [1739102002] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled

2020/08/24 12:38:25 [Info] [454248298] v2ray.com/core/proxy/vless/inbound: firstLen = 1258
2020/08/24 12:38:25 [Info] [454248298] v2ray.com/core/proxy/vless/inbound: received request for udp:192.168.1.1:3389
2020/08/24 12:38:25 [Info] [454248298] v2ray.com/core/app/dispatcher: taking detour [out-direct] for [udp:192.168.1.1:3389]
2020/08/24 12:38:25 [Info] [454248298] v2ray.com/core/proxy/freedom: opening connection to udp:192.168.1.1:3389

Client error log:

=== [[[ vless ]===
2020/08/24 12:38:25 [Info] [4219923563] v2ray.com/core/app/dispatcher: taking detour [out-vless_h2] for [tcp:192.168.1.1:3389]
2020/08/24 12:38:25 [Info] [4219923563] v2ray.com/core/proxy/vless/outbound: tunneling request to tcp:192.168.1.1:3389 via tcp:fqdn:443

2020/08/24 12:38:25 [Info] [3881669924] v2ray.com/core/proxy/dokodemo: received request for 192.168.0.56:61423
2020/08/24 12:38:25 [Info] [3881669924] v2ray.com/core/app/dispatcher: taking detour [out-vless_h2] for [udp:192.168.11.1:3389]
2020/08/24 12:38:25 [Info] [3881669924] v2ray.com/core/proxy/vless/outbound: tunneling request to udp:192.168.1.1:3389 via tcp:fqdn:443
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.
  1. Other configurations (such as Nginx) and logs.
    流程: v2client -(tls+h2)-> [internet] -(tls+h2)-> haproxy -(h2c)-> v2server

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

4.27.4在dns.servers设置为空数组的情况下会崩溃

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

  1. 你正在使用哪个版本的 V2Ray?

4.27.4(4.27.0正常)

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

访问任何需要dns的网站

  1. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

panic

  1. 你期待看到的正确表现是怎样的?

和4.27.0以及未设置dns的时候一样, 回退到使用系统dns.
不要问我为啥设置空数组, qv2ray的客户端是这么干的

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

客户端配置:

{
    "dns": {
        "servers": [
        ]
    },
...
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

客户端错误日志:

panic: runtime error: index out of range [0] with length 0

goroutine 66 [running]:
v2ray.com/core/app/dns.(*Server).Match(0xc000219ef0, 0x0, 0xef1f40, 0xc0000aa0a8, 0xc00084a590, 0xa, 0xc0034d6200, 0x1, 0x1, 0x0, ...)
        v2ray.com/core/app/dns/server.go:259 +0x830
v2ray.com/core/app/dns.(*Server).queryIPTimeout(0xc000219ef0, 0x0, 0xef1f40, 0xc0000aa0a8, 0xc00084a590, 0xa, 0x101, 0x800, 0x800, 0xd0bf80, ...)
        v2ray.com/core/app/dns/server.go:296 +0x1ff
v2ray.com/core/app/dns.(*Server).lookupIPInternal(0xc000219ef0, 0xc00084a590, 0xa, 0x101, 0xc0042c3b70, 0x66, 0xffffffffffffffff, 0x0, 0x0)
        v2ray.com/core/app/dns/server.go:411 +0x85d
v2ray.com/core/app/dns.(*Server).LookupIP(0xc000219ef0, 0xc00084a590, 0xa, 0xc001eae8e0, 0x9b1351, 0xc00084a590, 0xc0042c3b50, 0x9b0e00)
        v2ray.com/core/app/dns/server.go:302 +0x4d
v2ray.com/core/app/router.(*Context).GetTargetIPs(0xc0023c2960, 0x0, 0x0, 0x0)
        v2ray.com/core/app/router/router.go:161 +0x1e0
v2ray.com/core/app/router.getIPsFromTarget(0xc0023c2960, 0x0, 0x0, 0x153a770)
        v2ray.com/core/app/router/condition.go:112 +0x32
v2ray.com/core/app/router.(*MultiGeoIPMatcher).Apply(0xc0000a89e0, 0xc0023c2960, 0xc0042c3d00)
        v2ray.com/core/app/router/condition.go:144 +0x45
v2ray.com/core/app/router.(*ConditionChan).Apply(0xc0000a89a0, 0xc0023c2960, 0xed2900)
        v2ray.com/core/app/router/condition.go:33 +0x76
v2ray.com/core/app/router.(*Rule).Apply(...)
        v2ray.com/core/app/router/config.go:63
v2ray.com/core/app/router.(*Router).pickRouteInternal(0xc000256140, 0xf00a00, 0xc0023d1740, 0xed28c0, 0xca1980, 0xc000256300)
        v2ray.com/core/app/router/router.go:115 +0x317
v2ray.com/core/app/router.(*Router).PickRoute(0xc000256140, 0xf00a00, 0xc0023d1740, 0xca1980, 0xc000256300, 0x10, 0xc00005a300)
        v2ray.com/core/app/router/router.go:78 +0x4a
v2ray.com/core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0xc0002562c0, 0xf00a00, 0xc0023d1740, 0xc001a1a620, 0xf01d00, 0xc00005a300, 0x2000001bb)
        v2ray.com/core/app/dispatcher/default.go:268 +0x3e3
v2ray.com/core/app/dispatcher.(*DefaultDispatcher).Dispatch.func1(0xc001a1a620, 0xf00a00, 0xc0023d1740, 0xc000256300, 0xc00426e840, 0x2, 0x2, 0x1, 0xc001a1a520, 0xc000257100, ...)
        v2ray.com/core/app/dispatcher/default.go:223 +0x149
created by v2ray.com/core/app/dispatcher.(*DefaultDispatcher).Dispatch
        v2ray.com/core/app/dispatcher/default.go:208 +0x2ea
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

V2RAY_LOCATION_ASSET environment variable seems like has no effect

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    4.27.0

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    Update from 4.23.1 to 4.27.0 using https://github.com/v2fly/fhs-install-v2ray/blob/master/install-release.sh and restart the service

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)

And V2ray service will not start.

  1. What's your expectation?
    V2ray service start properly.

  2. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

    // Please attach your server configuration here.

Client configuration:

    // Please attach your client configuration here.
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
main: failed to read config files: [/usr/local/etc/v2ray/config.json] > v2ray.com/core/main/json: failed to execute v2ctl to convert config file. > v2ray.com/core/common/platform/ctlcmd: failed to execute v2ctl:
v2ctl> Read config:  /usr/local/etc/v2ray/config.json
v2ray.com/core/infra/conf: invalid field rule > v2ray.com/core/infra/conf: failed to load GeoIP: private > v2ray.com/core/infra/conf: failed to open file: geoip.dat > open /usr/local/bin/geoip.dat: no such file or directory > exit status 255

Client error log:

  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.
  1. Other configurations (such as Nginx) and logs.
    Systemd unit file:
# cat /etc/systemd/system/v2ray.service
[Unit]
Description=V2Ray Service
After=network.target nss-lookup.target

[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json
Restart=on-failure

[Install]
WantedBy=multi-user.target
  1. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

 /usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json -test
V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
2020/08/27 17:32:46 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl message>
v2ctl> Read config:  /usr/local/etc/v2ray/config.json
Configuration OK.
  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

v2ray专用域名无法在墙内获得解析

先说一下,我只是个算善于用google的小白,我知道这个问题与软件无关,但是没有其他可以学习的地方了。
失败客户端环境:windows v2ray 2.60.0,仅IPv4,WebSocket + TLS + Web+cdn(cloudflare)。昨天开始我的域名在墙内无法获得解析了,用了墙内各家DNS服务器都不行(不下于10家,nslookup 加参数查询,墙外是正常的),v2ray debug如下:
2020/09/21 09:58:15 [Info] [4209195477] v2ray.com/core/proxy/socks: TCP Connect request to tcp:域名:443
2020/09/21 09:58:15 [Info] [2051461616] v2ray.com/core/proxy/socks: TCP Connect request to tcp:域名:443
2020/09/21 09:58:15 [Info] [4209195477] v2ray.com/core/app/dispatcher: sniffed domain: 域名
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:上海联通DNS:53 querying DNS for: 域名.
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:上海联通DNS:53
2020/09/21 09:58:15 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:上海联通DNS:53
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:上海联通DNS:53
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dispatcher: taking detour [direct] for [udp:上海联通DNS:53]
2020/09/21 09:58:15 [Info] v2ray.com/core/proxy/freedom: opening connection to udp:上海联通DNS:53
2020/09/21 09:58:15 [Info] [2051461616] v2ray.com/core/app/dispatcher: sniffed domain: 域名
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:上海联通DNS:53 querying DNS for: 域名.
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:上海联通DNS:53
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:上海联通DNS:53
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dns: UDP:上海联通DNS:53 got answere: 域名. TypeAAAA -> [] 4.0002ms
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:上海联通DNS:53 updating IP records for domain:域名.
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dns: UDP:上海联通DNS:53 got answere: 域名. TypeAAAA -> [] 3.0001ms
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:上海联通DNS:53 updating IP records for domain:域名.
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dns: UDP:上海联通DNS:53 got answere: 域名. TypeA -> [] 35.002ms
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:上海联通DNS:53 updating IP records for domain:域名.
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain 域名 at server UDP:上海联通DNS:53 > rcode: 2
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:1.1.1.1:53 querying DNS for: 域名.
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/21 09:58:15 [Info] v2ray.com/core/transport/internet/udp: establishing new connection for udp:1.1.1.1:53
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain 域名 at server UDP:上海联通DNS:53 > rcode: 2
2020/09/21 09:58:15 [Debug] v2ray.com/core/app/dns: UDP:1.1.1.1:53 querying DNS for: 域名.
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/21 09:58:15 [Info] v2ray.com/core/app/dispatcher: default route for udp:1.1.1.1:53
2020/09/21 09:58:15 [Info] v2ray.com/core/common/mux: dispatching request to udp:1.1.1.1:53
2020/09/21 09:58:15 [Info] v2ray.com/core/transport/internet/websocket: creating connection to tcp:域名:443
2020/09/21 09:58:15 [Debug] v2ray.com/core/transport/internet/udp: dispatch request to: udp:1.1.1.1:53
2020/09/21 09:58:16 [Warning] failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://域名/helloworld): > dial tcp: lookup 域名: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://域名/helloworld): > dial tcp: lookup 域名: no such host v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://域名/helloworld): > dial tcp: lookup 域名: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.] > v2ray.com/core/common/retry: all retry attempts failed
2020/09/21 09:58:19 [Info] v2ray.com/core/app/dns: failed to lookup ip for domain 域名 at server UDP:1.1.1.1:53 > context deadline exceeded

临时解决方案,我在墙外用自己的vps dig 了一下域名,然后写入localhost,config文件中将专用域名改为localhost解析,目前正常。

另外我在另一个环境中是有IPv6的,查询DNS也是V6的,能够得到解析IP。

两个问题
1、这样算常态吗?
2、有什么长久一点的解决方案吗?

[Discuss] Enable user access to detailed routing information

What version of V2Ray are you using?

4.27.0

What's your scenario of using V2Ray?

Build a custom geosite/geoip file.

What did you see?

The demand is brought up in following issues (and more):

v2ray/discussion/issues/770

减少dns查询的话,我的方法是每次启动前都会读取上一次运行的acce.log,其中有这样

2020/07/04 04:18:17 tcp:127.0.0.1:41298 accepted tcp:api.vc.bilibili.com:443 [drOut] 
2020/07/04 04:18:43 tcp:127.0.0.1:41313 accepted tcp:google.com:443 [giaOut] 

通过自动提取giaOut行中的域名字段,合并到之前的域名文件中,重新生成dat文件,再启动v2ray。

//结合一下这个路由
{
    "type": "field",
    "outboundTag": "giaOut",
    "domain": [
        "ext:proxy.dat:giaOut"
    ]
}

这样之前代理过的网站就不会再查询dns了呢。相当个人定制个域名库

v2ray/discussion/issues/592

"log": {
"loglevel": "debug",
"access": "access.log"
},

cat access.log |grep proxy | awk '{print $5}'
sort uniq....

v2ray/discussion/issues/804

希望通过v2ray透明代理(v2ray在网关上)来看美国hbo/netfilx等美剧(有AirPlay/> chromcast之类的所以只能做全局代理)

v2ray在网关上配合iptables,使用了
"geosite:hbo",
"ext:h2y.dat:hbo",
等的数据库来决定走不走代理,但是感觉不够全,经常会出现错误,而如果在手机上用SR全部数据走代理的时候则不会出错。
请问有没有额外的数据库,或者简易点的爬相关视频网站ip的工具?
谢谢!

In a word, there are demands and practices to build a custom geosite/geoip file according to the routing information of V2Ray.

In referenced issues, outbound tag is used to classify domestic and oversea sites and to augment a custom geosite file when not included in standard ones.With routing context, there's much more that could also be done:

  • With trasparent proxy, we may track the source IP of devices like Nitendo Switch, so as to retrieve actual domains it uses and IPs of game servers.
  • With tools like proxychains, we can detour network of a specific application to a specific V2Ray inbound, then by tracking the inbound tag we are able to retrieve all the related domains and ips.

... and many of these information could be finally contributed to v2fly/domain-list-community.

What's your expectation?

Currently, usage of routing information goes around access.log, which provides following information:

  • Source IP
  • Srouce Port
  • Network
  • Target IP / Target Domain
  • Target Port
  • Outbound Tag

But there are some problems with access log:

  • Fields like inbound tag are absent.
  • Balancers not tracked, only the final outbound is reported.
  • Sniffed domains won't be used in log. Only proxy requests that directly send domain to inbound (e.g. http and socks) can get it shown in log. So transparent proxy with dokodemo-door inbound will result in an access log without any domain:
    2020/08/19 00:20:17 192.168.200.7:55724 accepted tcp:106.75.15.133:443 [direct] 
    2020/08/19 00:20:17 192.168.200.7:55423 accepted udp:192.168.200.1:53 [dns-out] 
    2020/08/19 00:20:18 192.168.200.7:55386 accepted tcp:149.154.175.100:443 [proxy] 
    
  • Usage of access log usually involves reading of on-disk log file (in stdout access and error log often get messed up), which poses potential privacy problem.

Considering above arguments, I expect to provide users a proper way of access to complete routing context, as well as keeping such access to restricted usage.

Routing rules should support source port matching

你正在使用哪个版本的 V2Ray?

4.27.0

你的使用场景是什么?

P2P类型的服务

你看到的不正常的现象是什么?

P2P服务里,两个主机的地位是对等的,因此当使用固定端口用于交互时,往往各自均会开放一个。由于目前V2Ray只有目标端口匹配,因此可能会出现一方流量直连,另一方流量代理(或更复杂)的现象。

以ZeroTier为例,其是一个构建虚拟局域网的服务,主要使用9993端口,用于在两个主机之间打洞、寻找通路。通过以下路由配置:

    {
      "type": "field",
      "network": "udp",
      "port": 9993,
      "outboundTag": "direct"
    }

可以不代理去向9993端口UDP流量,从而似乎可以保证建立的通道是直连的。但实际日志如下(由于几天前的日志丢失了,这里描述下大概流程……):

local:9993 -> remote:9993 [direct]
local:{dynamic} -> remote:9993 [direct]
local:9993 -> remote:{dynamic} [vps]

第三项从源9993端口到目标动态端口的流量被vps代理了,导致ZeroTier建立的通道不符合预期。最终在ZeroTier Central看到本地设备的Public IP变成了VPS的IP,而非本地运营商IP,也即P2P流量变成通过VPS中转,而非直连。

NTP服务也有这样的问题。尽管透明代理教程中都会设置UDP 123端口直连,但我也在日志中看到了ntpd服务(监听123端口)向远程服务器动态端口发送流量,同时被VPS代理了(虽然对时间同步来说,问题应该不大)。

你期待看到的正确表现是怎样的?

路由配置添加对于源端口匹配的支持,以能够让P2P服务的去程与回程行为一致,同时方便在透明代理中对于自己开放的服务(如SSH)进行路由管理。这也让端口与IP的匹配能力一致了(目前分别有"ip"与"source"以匹配目标ip与源ip)。

客户端配置

一份样例配置如下:

"routing": {
  "balancers": [
    {
      "tag": "zerotier",
      "selector": ["direct"] // for directly connecting two hosts
      // "selector": ["vps"] // for using vps as medium proxy tunnel
    }
  ],
  "rules": [
    {
      "type": "field",
      "network": "udp",
      "port": 9993,
      "balancerTag": "zerotier"
    },
    {
      "type": "field",
      "network": "udp",
      "sourcePort": 9993,
      "balancerTag": "zerotier"
    }
  ]
}

4.27的dns服务器返回空解析

Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    4.27.0
  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    正常
  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
    在4.27.0版本,在dns服务器设置中,走直连的dns解析一些域名随机返回空解析(相同域名不一定每次出现这个问题),致使访问出错。目前仅出现于透明代理和手机上的v2rayng(注意要开本地dns模式,用v2ray的dns object做dns服务器),相同配置文件在电脑上用socks5没有问题;不使用本地dns模式也没问题。所以怀疑是流量进入core的第一次解析为空,导致连接中止。
    提供一个检测的域名列表:
    zeptovm.com
    vultr.com
    olvps.com
    gullo.me
    halocloud.net
    idc.wiki
    linode.com
    xiuluohost.com
    以及一些个人博客(海外,最好是hk jp us tw的IP)
    随便找的一些idc(非广告),一般是ip符合代理规则,域名不包含在域名代理列表。他们出这个的问题的概率更大。

根据观察,dns服务器解析出错的与具体的dns object有关。
"dns": {
"hosts": {
"geosite:category-ads-all": "127.0.0.1",
"geosite:qihoo360": "127.0.0.1"
},
"servers": [
"223.5.5.5",
"223.6.6.6",
{
"address": "1.1.1.1",
"domains": [
"geolocation-!cn"
],
"port": 53
},
"1.0.0.1"
]
},
上述是存在该问题的配置,若更改为下述配置则无此问题(也可能概率太小
"dns": {
"hosts": {
"geosite:category-ads-all": "127.0.0.1",
"geosite:qihoo360": "127.0.0.1"
},
"servers": [
"1.1.1.1",
“1.0.0.1”,
{
"address": "223.5.5.5",
"domains": [
"geosite:cn"
],
"port": 53
},
"223.6.6.6"
]
},

根据
4) What's your expectation?
修复此问题
5) Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

    [config-server.txt](https://github.com/v2fly/v2ray-core/files/5141913/config-server.txt)

Client configuration:

   [config.txt](https://github.com/v2fly/v2ray-core/files/5141890/config.txt)
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

无(已确定是客户端故障)

Client error log:
08-28 14:31:52.530 I/GoLog ( 5839): [Debug] v2ray.com/core/app/dns: UDP:119.29.29.29:53 querying DNS for: olvps.com.
08-28 14:31:52.533 I/GoLog ( 5839): [Debug] v2ray.com/core/app/dns: UDP:119.29.29.29:53 querying DNS for: olvps.com.
08-28 14:31:52.548 I/GoLog ( 5839): [Info] v2ray.com/core/app/dns: UDP:119.29.29.29:53 got answere: olvps.com. TypeA -> [] 14.61323ms
08-28 14:31:52.548 I/GoLog ( 5839): [Debug] v2ray.com/core/app/dns: UDP:119.29.29.29:53 updating IP records for domain:olvps.com.
08-28 14:31:52.548 I/GoLog ( 5839): [Info] v2ray.com/core/app/dns: failed to lookup ip for domain olvps.com at server
08-28 14:31:52.585 I/GoLog ( 5839): [Info] v2ray.com/core/app/dns: UDP:119.29.29.29:53 got answere: olvps.com. TypeAAAA -> [] 54.463333ms
08-28 14:31:52.585 I/GoLog ( 5839): [Debug] v2ray.com/core/app/dns: UDP:119.29.29.29:53 updating IP records for domain:olvps.com.
08-28 14:31:52.586 I/GoLog ( 5839): [Info] v2ray.com/core/app/dns: failed to lookup ip for domain olvps.com at server
08-28 14:31:52.590 I/GoLog ( 5839): [Info] v2ray.com/core/app/dns: UDP:119.29.29.29:53 cache HIT olvps.com -> [] > empty response

之后的记录全是命中119的空缓存,也不查询其他dns了

Caddy TLS+Websocket,迁移配置文件并使用此脚本移除原4.25版安装4.60之后客户端不停报错502 Bad Gateway > websocket: bad handshake

RT,服务器端原来是使用官方的脚本安装的,之前从3.X一直覆盖升级到4.25均正常使用。看到v2fly更新了脚本就按网页提示迁移config.json配置文件到/usr/local/etc/v2ray/目录,移除了原4.25版本之后并用新脚本安装4.26之后,客户端就不停报错显示:

2020/07/10 11:55:00 [Warning] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://domian/ray): 502 Bad Gateway > websocket: bad handshake] > v2ray.com/core/common/retry: all retry attempts failed

服务器端配置文件:
{
"log": {
"loglevel": "info",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"inbounds": [
{
"port": 1024,
"listen":"127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "7eeb2ff8-0e79-4095-8010-83336e864f28",
"alterId": 64,
"level": 1
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/ray"
}
}
}
],
"inboundDetour": [
{
"listen": "127.0.0.1",
"port": 2048,
"protocol": "shadowsocks",
"settings": {
"method": "aes-256-gcm",
"password": "e7f82vb4n7w8anr12vaw87n",
"udp": true,
"network": "tcp,udp"
},
"tag": "shadowsocks"
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}

v2ray vless 协议443端口共用问题

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    v4.28.2
  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    Chrome 通过 Socks/VMess 代理观看 YouTube 视频
  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    在服务器上安装adguard home 并开启https ,无法与v2ray vless协议同时使用。 现在还是使用vmess +tls 的方式使用inbounds port 没有指定443。
  4. 你期待看到的正确表现是怎样的?
    使用vless协议 443端口能够公用
  5. 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:

    // 在这里附上服务器端配置文件
{
    "log": {
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": 443,
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "", // 填写你的 UUID
                        "level": 0,
                        "email": "[email protected]"
                    }
                ],
                "decryption": "none",
                "fallbacks": [
                    {
                        "dest": 80
                    },
                    {
                        "path": "/linxuan", // 必须换成自定义的 PATH
                        "dest": 1234,
                        "xver": 1
                    }
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "tls",
                "tlsSettings": {
                    "alpn": [
                        "http/1.1"
                    ],
                    "certificates": [
                        {
                            "certificateFile": "/usr/local/etc/v2ray/v2ray.crt", // 换成你的证书,绝对路径
                            "keyFile": "/usr/local/etc/v2ray/v2ray.key" // 换成你的私钥,绝对路径
                        }
                    ]
                }
            }
        },
        {
            "port": 15462,
            "listen": "127.0.0.1",
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "", // 填写你的 UUID
                        "level": 0,
                        "email": "[email protected]"
                    }
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws",
                "security": "none",
                "wsSettings": {
                    "acceptProxyProtocol": true, // 提醒:若你用 Nginx/Caddy 等反代 WS,需要删掉这行
                    "path": "/linxuan" // 必须换成自定义的 PATH,需要和上面的一致
                }
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom"
        }
    ]
}

客户端配置:

    // 在这里附上客户端配置
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

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

客户端错误日志:

    // 在这里附上客户端日志
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

升级V2RAY后无法正常上网

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

v2ray_util: 3.7.7.9

  1. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    Chrome 通过 Socks/VMess 代理观看 YouTube 视频

  2. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://wedail.com/09f9645b53c/): 502 Bad Gateway > websocket: bad handshake] > v2ray.com/core/common/retry: all retry attempts failed

  3. 你期待看到的正确表现是怎样的?
    正常访问youtube

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

{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"port":18453,
"listen": "127.0.0.1",
"tag": "vmess-in",
"protocol": "vmess",
"settings": {
"clients": [
{
"id":"8f7fb55d-c7be-452f-ac74-8ab49e2055ad",
"alterId":6688
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path":"/09f9645b53c/"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": { },
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": { },
"tag": "blocked"
}
],
"dns": {
"servers": [
"https+local://1.1.1.1/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8",
"8.8.4.4",
"localhost"
]
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"inboundTag": [
"vmess-in"
],
"outboundTag": "direct"
}
]

服务器端配置:

    // 在这里附上服务器端配置文件

客户端配置:
{
"policy": null,
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "proxy",
"port": 10808,
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true,
"ip": null,
"address": null,
"clients": null
},
"streamSettings": null
}
],
"outbounds": [
{
"tag": "proxy",
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "bbcc.com",
"port": 443,
"users": [
{
"id": "8f7fb55d-c7be-452f-ac74-8ab49e2055ad",
"alterId": 6688,
"email": "[email protected]",
"security": "auto"
}
]
}
],
"servers": null,
"response": null
},
"streamSettings": {
"network": "ws",
"security": "tls",
"tlsSettings": {
"allowInsecure": true,
"serverName": "bbcc.com"
},
"tcpSettings": null,
"kcpSettings": null,
"wsSettings": {
"connectionReuse": true,
"path": "/09f9645b53c/",
"headers": {
"Host": "bbcc.com"
}
},
"httpSettings": null,
"quicSettings": null
},
"mux": {
"enabled": true,
"concurrency": 8
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"vnext": null,
"servers": null,
"response": null
},
"streamSettings": null,
"mux": null
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"vnext": null,
"servers": null,
"response": {
"type": "http"
}
},
"streamSettings": null,
"mux": null
}
],
"stats": null,
"api": null,
"dns": null,
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"port": null,
"inboundTag": [
"api"
],
"outboundTag": "api",
"ip": null,
"domain": null
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "proxy",
"ip": null,
"domain": [
"geosite:google",
"geosite:github",
"geosite:netflix",
"geosite:steam",
"geosite:telegram",
"geosite:tumblr",
"geosite:speedtest",
"geosite:bbc",
"domain:gvt1.com",
"domain:textnow.com",
"domain:twitch.tv",
"domain:wikileaks.org",
"domain:naver.com"
]
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "proxy",
"ip": [
"91.108.4.0/22",
"91.108.8.0/22",
"91.108.12.0/22",
"91.108.20.0/22",
"91.108.36.0/23",
"91.108.38.0/23",
"91.108.56.0/22",
"149.154.160.0/20",
"149.154.164.0/22",
"149.154.172.0/22",
"74.125.0.0/16",
"173.194.0.0/16",
"172.217.0.0/16",
"216.58.200.0/24",
"216.58.220.0/24",
"91.108.56.116",
"91.108.56.0/24",
"109.239.140.0/24",
"149.154.167.0/24",
"149.154.175.0/24"
],
"domain": null
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "direct",
"ip": null,
"domain": [
"domain:12306.com",
"domain:51ym.me",
"domain:52pojie.cn",
"domain:8686c.com",
"domain:abercrombie.com",
"domain:adobesc.com",
"domain:air-matters.com",
"domain:air-matters.io",
"domain:airtable.com",
"domain:akadns.net",
"domain:apache.org",
"domain:api.crisp.chat",
"domain:api.termius.com",
"domain:appshike.com",
"domain:appstore.com",
"domain:aweme.snssdk.com",
"domain:bababian.com",
"domain:battle.net",
"domain:beatsbydre.com",
"domain:bet365.com",
"domain:bilibili.cn",
"domain:ccgslb.com",
"domain:ccgslb.net",
"domain:chunbo.com",
"domain:chunboimg.com",
"domain:clashroyaleapp.com",
"domain:cloudsigma.com",
"domain:cloudxns.net",
"domain:cmfu.com",
"domain:culturedcode.com",
"domain:dct-cloud.com",
"domain:didialift.com",
"domain:douyutv.com",
"domain:duokan.com",
"domain:dytt8.net",
"domain:easou.com",
"domain:ecitic.net",
"domain:eclipse.org",
"domain:eudic.net",
"domain:ewqcxz.com",
"domain:fir.im",
"domain:frdic.com",
"domain:fresh-ideas.cc",
"domain:godic.net",
"domain:goodread.com",
"domain:haibian.com",
"domain:hdslb.net",
"domain:hollisterco.com",
"domain:hongxiu.com",
"domain:hxcdn.net",
"domain:images.unsplash.com",
"domain:img4me.com",
"domain:ipify.org",
"domain:ixdzs.com",
"domain:jd.hk",
"domain:jianshuapi.com",
"domain:jomodns.com",
"domain:jsboxbbs.com",
"domain:knewone.com",
"domain:kuaidi100.com",
"domain:lemicp.com",
"domain:letvcloud.com",
"domain:lizhi.io",
"domain:localizecdn.com",
"domain:lucifr.com",
"domain:luoo.net",
"domain:mai.tn",
"domain:maven.org",
"domain:miwifi.com",
"domain:moji.com",
"domain:moke.com",
"domain:mtalk.google.com",
"domain:mxhichina.com",
"domain:myqcloud.com",
"domain:myunlu.com",
"domain:netease.com",
"domain:nfoservers.com",
"domain:nssurge.com",
"domain:nuomi.com",
"domain:ourdvs.com",
"domain:overcast.fm",
"domain:paypal.com",
"domain:paypalobjects.com",
"domain:pgyer.com",
"domain:qdaily.com",
"domain:qdmm.com",
"domain:qin.io",
"domain:qingmang.me",
"domain:qingmang.mobi",
"domain:qqurl.com",
"domain:rarbg.to",
"domain:rrmj.tv",
"domain:ruguoapp.com",
"domain:sm.ms",
"domain:snwx.com",
"domain:soku.com",
"domain:startssl.com",
"domain:store.steampowered.com",
"domain:symcd.com",
"domain:teamviewer.com",
"domain:tmzvps.com",
"domain:trello.com",
"domain:trellocdn.com",
"domain:ttmeiju.com",
"domain:udache.com",
"domain:uxengine.net",
"domain:weather.bjango.com",
"domain:weather.com",
"domain:webqxs.com",
"domain:weico.cc",
"domain:wenku8.net",
"domain:werewolf.53site.com",
"domain:windowsupdate.com",
"domain:wkcdn.com",
"domain:workflowy.com",
"domain:xdrig.com",
"domain:xiaojukeji.com",
"domain:xiaomi.net",
"domain:xiaomicp.com",
"domain:ximalaya.com",
"domain:xitek.com",
"domain:xmcdn.com",
"domain:xslb.net",
"domain:xteko.com",
"domain:yach.me",
"domain:yixia.com",
"domain:yunjiasu-cdn.net",
"domain:zealer.com",
"domain:zgslb.net",
"domain:zimuzu.tv",
"domain:zmz002.com",
"domain:samsungdm.com"
]
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "block",
"ip": null,
"domain": [
"geosite:category-ads"
]
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "direct",
"ip": [
"geoip:private"
],
"domain": null
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "direct",
"ip": [
"geoip:cn"
],
"domain": null
},
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "direct",
"ip": null,
"domain": [
"geosite:cn"
]
}
]
}
}

  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。
    2020/03/14 12:03:46 [Warning] v2ray.com/core: V2Ray 4.22.1 started
    2020/03/14 12:06:13 [Warning] v2ray.com/core: V2Ray 4.22.1 started
    2020/04/06 10:23:32 [Warning] v2ray.com/core: V2Ray 4.23.1 started
    2020/06/06 17:24:12 [Warning] v2ray.com/core: V2Ray 4.23.1 started
    2020/06/16 19:15:05 [Warning] v2ray.com/core: V2Ray 4.23.1 started

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

2020/06/07 09:16:47 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:cdn.mrfdev.com:443 [direct]
2020/06/07 09:16:47 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:cdn.mrfdev.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:lh3.googleusercontent.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:lh3.googleusercontent.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:stats.g.doubleclick.net:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:adservice.google.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:cdn.mrfdev.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:cdn.mrfdev.com:443 [direct]
2020/06/07 09:16:48 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:dl.google.com:443 [direct]
2020/06/07 09:16:49 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:49 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:pagead2.googlesyndication.com:443 [direct]
2020/06/07 09:16:49 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:www.google-analytics.com:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:stats.g.doubleclick.net:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:adservice.google.com.hk:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:adservice.google.com:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:partner.googleadservices.com:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:51 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:googleads.g.doubleclick.net:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:googleads.g.doubleclick.net:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:googleads.g.doubleclick.net:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:www.google.com:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:www.google.com.hk:443 [direct]
2020/06/07 09:16:53 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:16:54 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:www.google.com:443 [direct]
2020/06/07 09:16:54 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:tpc.googlesyndication.com:443 [direct]
2020/06/07 09:17:01 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:17:10 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:mrfdev.disqus.com:443 [direct]
2020/06/07 09:17:17 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59188 accepted tcp:checkappexec.microsoft.com:443 [direct]
2020/06/07 09:17:28 tcp:112.97.50.185:59068 accepted tcp:update.googleapis.com:443 [direct]
2020/06/07 09:17:28 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:update.googleapis.com:443 [direct]
2020/06/07 09:17:38 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:redirector.gvt1.com:80 [direct]
2020/06/07 09:17:38 tcp:112.97.50.185:59068 accepted tcp:r6---sn-a5meknll.gvt1.com:80 [direct]
2020/06/07 09:17:39 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:r6---sn-a5meknll.gvt1.com:80 [direct]
2020/06/07 09:17:55 tcp:112.97.50.185:59068 accepted tcp:raw.githubusercontent.com:443 [direct]
2020/06/07 09:18:04 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:github.com:443 [direct]
2020/06/07 09:18:10 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:github.com:443 [direct]
2020/06/07 09:18:11 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59156 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:18:11 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:ocsp.digicert.com:80 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:avatars1.githubusercontent.com:443 [direct]
2020/06/07 09:18:16 tcp:112.97.50.185:59068 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:112.97.50.185:59068 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:16 tcp:112.97.50.185:59068 accepted tcp:github.githubassets.com:443 [direct]
2020/06/07 09:18:20 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:www.google-analytics.com:443 [direct]
2020/06/07 09:18:22 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:api.github.com:443 [direct]
2020/06/07 09:18:22 tcp:112.97.50.185:59068 accepted tcp:collector.githubapp.com:443 [direct]
2020/06/07 09:18:22 tcp:112.97.50.185:59068 accepted tcp:ocsp.digicert.com:80 [direct]
2020/06/07 09:18:24 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:ocsp.digicert.com:80 [direct]
2020/06/07 09:18:25 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59218 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:18:26 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:nav.smartscreen.microsoft.com:443 [direct]
2020/06/07 09:18:26 tcp:112.97.50.185:59068 accepted tcp:github-production-release-asset-2e65be.s3.amazonaws.com:443 [direct]
2020/06/07 09:18:26 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:x.urs.microsoft.com:443 [direct]
2020/06/07 09:18:27 tcp:112.97.50.185:59068 accepted tcp:ocsp.digicert.com:80 [direct]
2020/06/07 09:18:27 tcp:[2408:84f3:2c80:7c95:91:1d0a:9eab:570a]:59138 accepted tcp:ocsp.digicert.com:80 [direct]
2020/06/07 09:18:30 tcp:112.97.50.185:59068 accepted tcp:chrome.google.com:443 [direct]

  1. 其它相关的配置文件(如 Nginx)和相关日志。
    server {
    listen 443 ssl http2;
    listen [::]:443 http2;
    ssl_certificate /data/v2ray.crt;
    ssl_certificate_key /data/v2ray.key;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
    server_name bbcc.com;
    index index.html index.htm;
    root /home/wwwroot/3DCEList;
    error_page 400 = /400.html;

     # Config for 0-RTT in TLSv1.3
     ssl_early_data on;
     ssl_stapling on;
     ssl_stapling_verify on;
     add_header Strict-Transport-Security "max-age=31536000";
    
     location /09f9645b53c/
     {
     proxy_redirect off;
     proxy_pass http://127.0.0.1:18453;
     proxy_http_version 1.1;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "upgrade";
     proxy_set_header Host $http_host;
    
     # Config for 0-RTT in TLSv1.3
     proxy_set_header Early-Data $ssl_early_data;
     }
    

}
server {
listen 80;
listen [::]:80;
server_name bbcc.com;
return 301 https://bbcc.com$request_uri;
}
9) 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

Report for ' failed to bind source address > address already in use' when using tproxy

基本信息

V2Ray版本:4.26.0

使用场景:透明代理

问题现象

以本Issue的环境为例:配置好透明代理后,所有UDP流量均通过DokodemoDoor,在日志中可以看到所有123端口(ntp服务)的UDP流量均在建立连接时绑定源地址失败:

v2ray.com/core/transport/internet/udp: UDP original destination: udp:94.237.64.20:123
[3564221040] v2ray.com/core/proxy/dokodemo: processing connection from: 192.168.200.8:123
[3564221040] v2ray.com/core/app/dispatcher: taking detour [direct] for [udp:94.237.64.20:123]
[3564221040] v2ray.com/core/transport/internet: failed to bind source address to [94 237 64 20] > address already in use
v2ray.com/core/transport/internet/udp: UDP original destination: udp:185.255.55.20:123
[2289564324] v2ray.com/core/proxy/dokodemo: processing connection from: 192.168.200.8:123
[2289564324] v2ray.com/core/transport/internet: failed to bind source address to [185 255 55 20] > address already in use
[2289564324] v2ray.com/core/app/dispatcher: taking detour [direct] for [udp:185.255.55.20:123]
[2289564324] v2ray.com/core/proxy/freedom: opening connection to udp:185.255.55.20:123

v2ray/v2ray-core#2484 的环境为例:AdGuard Home 监听了 53 端口,默认监听 0.0.0.0 这个地址时会有同样问题,而如果把 AdGuard Home 的监听地址改为 127.0.0.1 则正常。

v2ray/v2ray-core#1971 的环境为例:在透明代理环境中开放 UDP 53 端口作为 DNS 服务器出现问题。

问题调查

以上几个现象描述综合起来,造成该报错的原因已经比较明显了。不过上面的描述是我在调查清楚原因后回来查Issue总结出来的,因此下面还是将调查的过程贴一下,供他人参考。

问题产生位置

这个报错是在DokodemoDoor.Process中,使用TProxy模式处理UDP连接时产生的:

sockopt := &internet.SocketConfig{
Tproxy: internet.SocketConfig_TProxy,
}
if dest.Address.Family().IsIP() {
sockopt.BindAddress = dest.Address.IP()
sockopt.BindPort = uint32(dest.Port)
}
tConn, err := internet.DialSystem(ctx, net.DestinationFromAddr(conn.RemoteAddr()), sockopt)

DokodemoDoor从Inbound接受了Client建立过来的UDP连接(conn)后,额外新建了一个连接(tConn)用于回复Client。DokodemoDoor尝试为这个新连接(tConn)的sock绑定原Client的目标地址时,发生了上述错误。

问题产生原因

UDP下TProxy模式的工作原理是:通过代理先从外网中获得原请求的响应结果,将结果写入另一个连接,该连接的源地址绑定到原请求的目标IP:Port,假装这个连接是从外网回来的(即使透明代理的设备并没有这个IP)并返回,因此才产生了source address是外网IP的现象。因此,需要检查有哪些现存的socket与要绑定的外网IP:Port冲突。

在本Issue的环境中,通过netstat检查端口占用:

$ netstat -nap | grep :123
udp        0      0 10.147.17.8:123         0.0.0.0:*                           6798/ntpd           
udp        0      0 192.168.200.8:123       0.0.0.0:*                           6798/ntpd           
udp        0      0 127.0.0.1:123           0.0.0.0:*                           6798/ntpd           
udp        0      0 0.0.0.0:123             0.0.0.0:*                           6798/ntpd
udp6       0      0 fe80::6cb5:e3ff:fef:123 :::*                                6798/ntpd           
udp6       0      0 fe80::dea6:32ff:fe4:123 :::*                                6798/ntpd           
udp6       0      0 ::1:123                 :::*                                6798/ntpd           
udp6       0      0 :::123                  :::*                                6798/ntpd

可以看到ntpd服务占用了123端口,并且有一个wildcard监听地址:0.0.0.0:123。尽管这种地址的初心是能绑定所有网口的IP,但其也能够匹配所有外网IP,从而造成了tConn的源地址绑定失败。

v2ray/v2ray-core#2484 中,作者使用AdGuard Home默认监听0.0.0.0地址时,同样出现了address already in use问题。在v2ray/v2ray-core#1971v2ray/v2ray-core#2142 中,作者使用DokodemoDoor开放53端口作DNS服务器,也是默认使用0.0.0.0监听,从而导致所有tConn模拟的DNS回复的源地址(如8.8.4.4:53)绑定失败。这验证了上面的分析。

尝试解决的结果

/etc/ntp.conf中,添加配置:

interface ignore wildcard
interface listen lo
interface listen eth0

再重启ntpd,通过netstat可以看到v2ray能正常绑定123端口的外网IP了:

tcp        0      0 127.0.0.1:8123          0.0.0.0:*               LISTEN      339390/runtime/v2ray
udp        0      0 202.112.29.82:123       192.168.200.8:123       ESTABLISHED 339390/runtime/v2ray 
udp        0      0 139.199.215.251:123     192.168.200.8:123       ESTABLISHED 339390/runtime/v2ray 
udp        0      0 119.28.206.193:123      192.168.200.8:123       ESTABLISHED 339390/runtime/v2ray 
udp        0      0 144.76.76.107:123       192.168.200.8:123       ESTABLISHED 339390/runtime/v2ray 
udp        0      0 203.107.6.88:123        192.168.200.8:123       ESTABLISHED 339390/runtime/v2ray
udp        0      0 192.168.200.8:123       0.0.0.0:*                           339563/ntpd         
udp        0      0 127.0.0.1:123           0.0.0.0:*                           339563/ntpd         
udp6       0      0 fe80::dea6:32ff:fe4:123 :::*                                339563/ntpd         
udp6       0      0 ::1:123                 :::*                                339563/ntpd 

现在考虑可否通过修改V2Ray来主动规避此类问题。v2ray/v2ray-core#1940v2ray/v2ray-core#2228 各自为Outbound和Inbound的连接绑定了SO_REUSEADDRSO_REUSEPORT选项,使得V2Ray的Sockets默认有了Reuse许可。但这两个PR并未成功解决v2ray/v2ray-core#1971 中的Bug,这个Issue中还存在一个问题没有解决,见#69

以上问题修正后,所有V2Ray inbound监听的0.0.0.0:port均可允许tConn重用端口了。

但是ntpd不是这样。根据创建Sockets的源码可以看出,其监听的0.0.0.0:123并没有开启SO_REUSEADDR/SO_REUSEPORT。这使得V2Ray方的连接不管如何设置地址/端口重用,都无法绑定上123端口。

实际上,ntpd启动过程中并不是完全没有开启端口重用。上面的netstat中可以看见除了0.0.0.0:123外,ntpd还重用了端口绑定了若干本地IP。这是因为ntpd先绑定了0.0.0.0:123,并据此寻找到所有本地网卡IP,再暂时性地开启0.0.0.0:123SO_REUSEADDR,成功在所有本地IP:123上建立Socket后,因“安全性原因”关闭了该设置,因此V2Ray仍然无法使用端口。

总结

个人认为,以Issue作者目前的知识水平,无法以小规模的改动从V2Ray角度规避所有的address already in use问题。V2Ray inbound造成的绑定失败将经由#70 解决,但对于外部服务监听0.0.0.0造成的绑定失败,鉴于目前V2Ray UDP TProxy机制的设计(额外建立了一个tConn),Issue作者暂不能找出能成功绑定的解决方案。

因此这个Bug Report,若V2Ray Team认定为wontfix,可以直接close,或是将其transfer到v2ray/discussion中。本Issue的内容虽然不能直接为V2Ray修复问题,但可以作为参考更新一下@ToutyRater 的Guide中透明代理一节的备注:

若V2Ray Inbound监听0.0.0.0,可以正常使用;但若一个外部服务监听了0.0.0.0并产生了端口冲突,则需要:

  1. 修改冲突服务的配置,令其不监听0.0.0.0(或能设置SO_REUSEADDR就更好了);
  2. 若冲突的服务只需直连(ntp就是这样的服务),可以直接在iptables规则中令其直连,不交由V2Ray代理,从而规避问题。

参考资料

  1. linux - How do SO_REUSEADDR and SO_REUSEPORT differ? - Stack Overflow
  2. https://rextester.com/BUAFK86204 测试SO_REUSEADDRSO_REUSEPORT各自设置时的绑定效果
  3. https://github.com/Dreamacro/clash/issues/616#issuecomment-611961492 对问题的原因分析基本一致

Windows10系统无法运行Windows32+Windows64(v4.26.0)

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)

  4. 你期待看到的正确表现是怎样的?

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

服务器端配置:

    // 在这里附上服务器端配置文件

客户端配置:

    // 在这里附上客户端配置
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

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

客户端错误日志:

    // 在这里附上客户端日志
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

Bittorrent Sniffing does not support uTP

你正在使用哪个版本的 V2Ray?

4.27.0

你的使用场景是什么?

BT流量直连/抛弃。

你看到的不正常的现象是什么?

Sniffing功能似乎只支持基于TCP的Bittorrent 1.0协议,而不支持基于UDP的uTP协议。

理论基于以下两点:

  • 只在TCP流量中才有Sniffing处理代码:

    if destination.Network != net.Network_TCP || !sniffingRequest.Enabled {
    go d.routedDispatch(ctx, outbound, destination)
    } else {
    go func() {
    cReader := &cachedReader{
    reader: outbound.Reader.(*pipe.Reader),
    }
    outbound.Reader = cReader
    result, err := sniffer(ctx, cReader)
    if err == nil {
    content.Protocol = result.Protocol()
    }
    if err == nil && shouldOverride(result, sniffingRequest.OverrideDestinationForProtocol) {
    domain := result.Domain()
    newError("sniffed domain: ", domain).WriteToLog(session.ExportIDToError(ctx))
    destination.Address = net.ParseAddress(domain)
    ob.Target = destination
    }
    d.routedDispatch(ctx, outbound, destination)
    }()
    }

  • Bittorrent Sniffer里只对1.0版本基于TCP的协议的握手包有嗅探(即检测"Bittorrent Protocol"的存在):

    func SniffBittorrent(b []byte) (*SniffHeader, error) {
    if len(b) < 20 {
    return nil, common.ErrNoClue
    }
    if b[0] == 19 && string(b[1:20]) == "BitTorrent protocol" {
    return &SniffHeader{}, nil
    }
    return nil, errNotBittorrent
    }

以及现象基于以下两点:

  • 客户端设置了BT直连,服务端设置了BT堵塞,但在过去半年间吃了三次DMCA Request(。)
  • 传输了BT流量的设备使用了Mellow,通过TUN模式其能接收UDP流量,并对非CN IP选择了代理,因此服务端是有可能收到uTP流量并因没有嗅探到BT协议而放行的。

你期待看到的正确表现是怎样的?

不再吃DMCA Requests了对于一般情况下的两种BT协议(TCP,uTP)能准确嗅探以在路由中匹配。

Access / Error 日志

由于对BT原理了解不足,暂没有准备好环境提供测试复现。这个Issue是在看了Sniffing相关代码有一些原理上的疑惑后发出来的,希望得到社区的解惑。条件合适时会仔细测试并提供日志。

shadowsocks端口接受随机数据,日志显示accepted

除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

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

  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    shadowsocks,使用非AEAD的加密方式

  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    密码错误,加密错误,甚至完全随机的数据都有可能被服务端接受,日志显示accepted,代理目的地址是一个随机的不存在的IP。
    比如下面的log中:

2020/09/04 16:20:36 xx.xx.xx.xx:24247 accepted tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361 [direct] 

  1. 你期待看到的正确表现是怎样的?
    除非遭到重复攻击,不合理的数据包都reject。

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

服务器端配置:

{
    "log": {
        "loglevel": "info"
    },
    "inbounds": [
        {
            "protocol": "shadowsocks",
            "port": 5566,
            "settings": {
                "method": "chacha20",
                "password": "8pqI7NH0R3WcqGug"
            }
        }
    ],
    "outbounds": [
        {
            "tag": "direct",
            "protocol": "freedom"
        }
    ]
}

客户端配置:

使用v2ray,或任意ss客户端,用错误的密码连接上述节点。

{
    "log": {
        "loglevel": "info"
    },
    "inbounds": [
        {
            "tag": "socks",
            "protocol": "socks",
            "port": 1080
        }
    ],
    "outbounds": [
        {
            "tag": "ss",
            "protocol": "shadowsocks",
            "settings": {
                "servers": [
                    {
                        "address": "--",
                        "port": 5566,
                        "method": "chacha20",
                        "password": "fi8oIsAbIIaIMURt"
                    }
                ]
            }
        }
    ]
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

注意看,其中出现了accepted

V2Ray 4.27.5 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.7 linux/386)
A unified platform for anti-censorship.
2020/09/04 16:17:31 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl message> 
v2ctl> Read config:  /root/v2/config.json
2020/09/04 16:17:31 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:5566
2020/09/04 16:17:31 [Warning] v2ray.com/core: V2Ray 4.27.5 started
2020/09/04 16:17:38 [Info] [1538593994] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24108 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:17:38 xx.xx.xx.xx:24108 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:17:38 [Info] [1855410390] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24111 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 5
2020/09/04 16:17:38 xx.xx.xx.xx:24111 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 5
2020/09/04 16:17:49 [Info] [1542847096] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24119 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:17:49 xx.xx.xx.xx:24119 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:17:55 [Info] [537808210] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24134 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:17:55 xx.xx.xx.xx:24134 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:17:56 [Info] [3874713848] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24133 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:17:56 xx.xx.xx.xx:24133 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:18:03 [Info] [2437959274] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24137 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 13
2020/09/04 16:18:03 xx.xx.xx.xx:24137 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 13
2020/09/04 16:18:03 [Info] [3299255048] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24135 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: invalid domain name: g¨ظIR𨏲 
2020/09/04 16:18:03 xx.xx.xx.xx:24135 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: invalid domain name: g¨ظIR𨏲 
2020/09/04 16:18:03 [Info] [3307279943] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24136 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:03 xx.xx.xx.xx:24136 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:03 [Info] [3720496936] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24142 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:03 xx.xx.xx.xx:24142 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:03 [Info] [1964647204] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24125 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:18:03 xx.xx.xx.xx:24125 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:18:04 [Info] [2956689442] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24113 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:18:04 xx.xx.xx.xx:24113 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:18:04 [Info] [2418463760] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24112 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:04 xx.xx.xx.xx:24112 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:04 [Info] [2065389011] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24144 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:04 xx.xx.xx.xx:24144 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:04 [Info] [2651427755] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24116 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:18:04 xx.xx.xx.xx:24116 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:18:04 [Info] [3001928282] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24109 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 10
2020/09/04 16:18:04 [Info] [3710265639] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24107 > v2ray.com/core/proxy/shadowsocks: invalid OTA
2020/09/04 16:18:04 xx.xx.xx.xx:24109 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 10
2020/09/04 16:18:04 xx.xx.xx.xx:24107 rejected  v2ray.com/core/proxy/shadowsocks: invalid OTA
2020/09/04 16:18:04 [Info] [1614027189] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24110 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: invalid domain name: ޝG¹󿾞"~ 
0𷤚ܲ6    [Ⱥ:ph邖^¥ļ2<U6­󎉊dݨ淳׀ Γ渦ᦑ񹛂±¶p¤
                                         (Iޗ뫳㍥(魡Cc򎤰
2020/09/04 16:18:04 xx.xx.xx.xx:24110 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: invalid domain name: ޝG¹󿾞"~ 
0𷤚ܲ6    [Ⱥ:ph邖^¥ļ2<U6­󎉊dݨ淳׀ Γ渦ᦑ񹛂±¶p¤
                                         (Iޗ뫳㍥(魡Cc򎤰
2020/09/04 16:18:21 [Info] [896442123] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24149 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:18:21 xx.xx.xx.xx:24149 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:18:30 xx.xx.xx.xx:24158 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 9
2020/09/04 16:18:30 [Info] [2254099718] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24158 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 9
2020/09/04 16:18:34 [Info] [3781672064] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24164 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 11
2020/09/04 16:18:34 xx.xx.xx.xx:24164 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 11
2020/09/04 16:18:35 [Info] [3458963329] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24168 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:18:35 xx.xx.xx.xx:24168 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:18:36 [Info] [2329760430] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24169 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 2
2020/09/04 16:18:36 xx.xx.xx.xx:24169 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 2
2020/09/04 16:18:36 [Info] [2148865345] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24170 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 13
2020/09/04 16:18:36 xx.xx.xx.xx:24170 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 13
2020/09/04 16:18:44 [Info] [3174996849] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24171 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:18:44 xx.xx.xx.xx:24171 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:18:44 [Info] [3773716677] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24178 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:44 xx.xx.xx.xx:24178 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:45 [Info] [3553190965] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24180 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:45 xx.xx.xx.xx:24180 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 12
2020/09/04 16:18:46 [Info] [284869582] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24181 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:46 xx.xx.xx.xx:24181 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:18:58 [Info] [2577368195] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24163 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:18:58 xx.xx.xx.xx:24163 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 6
2020/09/04 16:19:12 [Info] [448328511] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24148 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:12 xx.xx.xx.xx:24148 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:12 [Info] [662478466] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24147 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:12 xx.xx.xx.xx:24147 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:13 [Info] [113784714] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24162 > v2ray.com/core/proxy/shadowsocks: invalid OTA
2020/09/04 16:19:13 xx.xx.xx.xx:24162 rejected  v2ray.com/core/proxy/shadowsocks: invalid OTA
2020/09/04 16:19:13 [Info] [1966823126] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24161 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:19:13 xx.xx.xx.xx:24161 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 15
2020/09/04 16:19:13 [Info] [3738444424] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24150 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:13 xx.xx.xx.xx:24150 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 7
2020/09/04 16:19:15 xx.xx.xx.xx:24159 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 0
2020/09/04 16:19:15 [Info] [1024449309] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24159 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 0
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/proxy/shadowsocks: tunnelling request to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 xx.xx.xx.xx:24247 accepted tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361 [direct] 
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/app/dispatcher: default route for tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/proxy/freedom: opening connection to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:36 [Info] [935975656] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361
2020/09/04 16:20:37 [Info] [935975656] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: failed to open connection to tcp:[cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361 > v2ray.com/core/common/retry: [dial tcp [cf20:b415:e0c3:e933:96ed:f22b:47df:1399]:35361: connect: network is unreachable] > v2ray.com/core/common/retry: all retry attempts failed
2020/09/04 16:20:37 [Info] [935975656] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: connection ends > io: read/write on closed pipe
2020/09/04 16:20:40 [Info] [3937538773] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24246 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 11
2020/09/04 16:20:40 xx.xx.xx.xx:24246 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 11
2020/09/04 16:20:44 [Info] [2503041462] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24254 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 5
2020/09/04 16:20:44 xx.xx.xx.xx:24254 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 5
2020/09/04 16:20:44 [Info] [1156340139] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24253 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:20:44 xx.xx.xx.xx:24253 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 14
2020/09/04 16:21:04 xx.xx.xx.xx:24263 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 2
2020/09/04 16:21:04 [Info] [3133540021] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24263 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 2
2020/09/04 16:21:04 [Info] [1054938379] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/shadowsocks: failed to create request from: xx.xx.xx.xx:24262 > v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 8
2020/09/04 16:21:04 xx.xx.xx.xx:24262 rejected  v2ray.com/core/proxy/shadowsocks: failed to read address > v2ray.com/core/common/protocol: unknown address type: 8

客户端错误日志:

  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

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

v4.28.1版本导致使用Just My Socks无法连接外网

系统版本:Windows 10
V2rayN版本:3.23
v2rayCore版本:4.28.1
服务器提供商:Just My Socks
问题复现:用以上版本进行搭建后,无法访问外网,如谷歌、YouTube、推特等,而如果将v2rayCore降级到4.27.5则可以访问外网。我也咨询了Just My Socks客服,被告知“The latest v2ray update (4.28+) has incompatibility issue, please downgrade for the time being.”可见确实是因为目前最新版本的v2rayCore与Just My Socks不兼容导致无法访问外网
image

V2Ray doesn't respect /etc/gai.conf

Please read the instruction and answer the following questions before submitting your issue. Thank you.
Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?

Server: unstable-e425876afe56564e82a528661438aa95857632a7 (This issue doesn't appear on latest stable version 4.26.0, only on unstable version)

Client: 4.26.0

  1. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

/etc/gai.conf is the config file for getaddrinfo(3). I want V2Ray prefer IPv4 connections over IPv6 by setting precedence ::ffff:0:0/96 100 in /etc/gai.conf.

  1. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)

When visiting websites, V2Ray prefers IPv6 connections instead of IPv4 (the websites display server's IPv6 address).

  1. What's your expectation?

V2Ray prefers IPv4 connections instead of IPv6 (the websites display server's IPv4 address).

  1. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

{
  "inbounds": [
    {
      "port": 443,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "",
            "alterId": 4
          }
        ]
      },
      "streamSettings": {
        "security": "tls",
        "tlsSettings": {
          "certificates": [
            {
              "certificateFile": "",
              "keyFile": ""
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

Client configuration: Not relevant to this issue, but I'm willing to provide if it is needed.

  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

    // Please attach your server error log here.

Client error log:

    // Please attach your client error log here.
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.

This is the access log when loglevel is set to debug and then visit http://google.com/search?q=1:

V2Ray 4.26.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
2020/08/04 11:34:20 [Debug] v2ray.com/core/app/log: Logger started
2020/08/04 11:34:20 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on 0.0.0.0:443
2020/08/04 11:34:20 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:443
2020/08/04 11:34:20 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl message>
v2ctl> Read config:  config.json
2020/08/04 11:34:20 [Warning] v2ray.com/core: V2Ray 4.26.0 started
2020/08/04 11:34:22 [Info] [696230717] v2ray.com/core/proxy/vmess/inbound: received request for tcp:google.com:80
2020/08/04 11:34:22 [Info] [696230717] v2ray.com/core/app/dispatcher: default route for tcp:google.com:80
2020/08/04 11:34:22 [Info] [696230717] v2ray.com/core/proxy/freedom: opening connection to tcp:google.com:80
2020/08/04 11:34:22 [Info] [696230717] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:google.com:80
2020/08/04 11:34:22 x:12577 accepted tcp:google.com:80
2020/08/04 11:34:22 [Info] [696230717] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled
2020/08/04 11:34:23 [Info] [1389776534] v2ray.com/core/proxy/vmess/inbound: received request for tcp:www.google.com:80
2020/08/04 11:34:23 [Info] [1389776534] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:80
2020/08/04 11:34:23 [Info] [1389776534] v2ray.com/core/proxy/freedom: opening connection to tcp:www.google.com:80
2020/08/04 11:34:23 [Info] [1389776534] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:www.google.com:80
2020/08/04 11:34:23 x:12583 accepted tcp:www.google.com:80
2020/08/04 11:34:23 [Info] [1389776534] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/freedom: connection ends > context canceled
2020/08/04 11:34:24 [Info] [615817618] v2ray.com/core/proxy/vmess/inbound: received request for tcp:www.google.com:443
2020/08/04 11:34:24 [Info] [615817618] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443
2020/08/04 11:34:24 [Info] [615817618] v2ray.com/core/proxy/freedom: opening connection to tcp:www.google.com:443
2020/08/04 11:34:24 [Info] [615817618] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:www.google.com:443
2020/08/04 11:34:24 x:12585 accepted tcp:www.google.com:443
2020/08/04 11:34:25 [Info] [3665469194] v2ray.com/core/proxy/vmess/inbound: received request for tcp:www.gstatic.com:443
2020/08/04 11:34:25 [Info] [3665469194] v2ray.com/core/app/dispatcher: default route for tcp:www.gstatic.com:443
2020/08/04 11:34:25 [Info] [3665469194] v2ray.com/core/proxy/freedom: opening connection to tcp:www.gstatic.com:443
2020/08/04 11:34:25 [Info] [3665469194] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:www.gstatic.com:443
2020/08/04 11:34:25 x:12583 accepted tcp:www.gstatic.com:443
2020/08/04 11:34:26 [Info] [2993755919] v2ray.com/core/proxy/vmess/inbound: received request for tcp:edge.microsoft.com:443
2020/08/04 11:34:26 [Info] [2993755919] v2ray.com/core/app/dispatcher: default route for tcp:edge.microsoft.com:443
2020/08/04 11:34:26 [Info] [2993755919] v2ray.com/core/proxy/freedom: opening connection to tcp:edge.microsoft.com:443
2020/08/04 11:34:26 [Info] [2993755919] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:edge.microsoft.com:443
2020/08/04 11:34:26 x:12630 accepted tcp:edge.microsoft.com:443
2020/08/04 11:34:27 [Info] [797891954] v2ray.com/core/proxy/vmess/inbound: received request for tcp:fonts.gstatic.com:443
2020/08/04 11:34:27 [Info] [797891954] v2ray.com/core/app/dispatcher: default route for tcp:fonts.gstatic.com:443
2020/08/04 11:34:27 [Info] [797891954] v2ray.com/core/proxy/freedom: opening connection to tcp:fonts.gstatic.com:443
2020/08/04 11:34:27 [Info] [797891954] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:fonts.gstatic.com:443
2020/08/04 11:34:27 x:12631 accepted tcp:fonts.gstatic.com:443
  1. Other configurations (such as Nginx) and logs.

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

  1. Additional info

I can still use domainStrategy to force V2Ray use IPv4 address, for example:

{
  "routing": {
    "rules": [
      {
        "type": "field",
        "domain": [
          "geosite:google"
        ],
        "outboundTag": "ipv4"
      }
    ]
  },
  "outbounds": [
    {
      "tag": "ipv4",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIPv4"
      }
    }
  ]
}

安装脚本无法成功安装v2ray

Please read the instruction and answer the following questions before submitting your issue. Thank you.
Please answer all the questions with enough information. All issues not following this template will be closed immediately.
If you are not sure if your question is truely a bug in V2Ray, please discuss it here first.

  1. What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)?
    v4.26.0

  2. What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.
    Github

  3. What did you see? (Please describe in detail, such as timeout, fake TLS certificate etc)
    Failed to stop v2ray.service: Unit v2ray.service not loaded

  4. What's your expectation?
    install v2ray

  5. Please attach your configuration file (Mask IP addresses before submit this issue).

Server configuration:

    // Please attach your server configuration here.

Client configuration:

    // Please attach your client configuration here.
  1. Please attach error logs, especially the bottom lines if the file is large. Error log file is usually at /var/log/v2ray/error.log on Linux.

Server error log:

    // Please attach your server error log here.

Client error log:

    // Please attach your client error log here.
  1. Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
    // Please attach your server access log here.
  1. Other configurations (such as Nginx) and logs.

  2. If V2Ray doesn't run, please attach output from --test.

The command is usually /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json, but may vary according to your scenario.

  1. If V2Ray service doesn't run, please attach journal log.

Usual command is journalctl -u v2ray.

Please review your issue before submitting.

旧版本已经使用脚本移除
bash <(curl -L https://install.direct/go.sh) --remove
然后使用新的安装
bash <(curl https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

提示截图报错, 如果使用旧的脚本安装是可以正常安装的, 系统CentOS7 X64, 这是要手动安装v2ray才可以吗

image

image

希望增加对SS加密rc4支持

配置成功
Shadowsocks-SS(47***110:476)
启动服务(2020/9/13 20:19:15)...
2020/09/13 20:19:15 Using default config: D:\Software\Proxy\v2rayN-Core\config.json

V2Ray 4.28.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.15.2 windows/amd64)
A unified platform for anti-censorship.
main: failed to read config files: [D:\Software\Proxy\v2rayN-Core\config.json] > v2ray.com/core/main/json: failed to execute v2ctl to convert config file. > v2ray.com/core/common/platform/ctlcmd: failed to execute v2ctl:
v2ctl> Read config: D:\Software\Proxy\v2rayN-Core\config.json
v2ray.com/core/infra/conf: unknown cipher method: rc4-md5 > exit status 4294967295

Proposal for resolving local domain in built-in DNS

你正在使用哪个版本的 V2Ray?

4.27.0

你的使用场景是什么?

透明代理/开放DNS服务器到53端口供局域网内使用

你看到的不正常的现象是什么?

V2Ray的内置DNS拒绝解析无点的域名。无点的域名不仅不能交由DNS Server解析,也无法进入Static Host查询:

func (s *Server) lookupIPInternal(domain string, option IPOption) ([]net.IP, error) {
if domain == "" {
return nil, newError("empty domain name")
}
// normalize the FQDN form query
if domain[len(domain)-1] == '.' {
domain = domain[:len(domain)-1]
}
// skip domain without any dot
if !strings.Contains(domain, ".") {
return nil, newError("invalid domain name").AtWarning()
}
ips := s.lookupStatic(domain, option, 0)

这导致的问题有:

  • 无法解析localhost。
  • 无法解析自己的主机名 (某些版本下sudo会往DNS查询主机名,本来通过systemd-resolved之类服务可以正确返回,但送给V2Ray后会被拒绝且不给回复,导致sudo卡很长一段时间才有响应,见v2ray/v2ray-core#2618 )。
  • 无法解析诸如Mijia Cloud之类的似乎是路由器设定的域名(然后被路由器内置DNS返回IP),见v2ray/v2ray-core#1913, v2ray/v2ray-core#2615
  • 在安卓端使用时,会在日志中看到大量意义不明的乱码无点域名查询,导致日志刷出大量的invalid domain name。
  • 一些公司内网的管理页面就是无点域名。

你期待看到的正确表现是怎样的?

内置DNS应当对无点/本地域名提供更好的支持,包括:

  • 允许无点域交由Static Host与DNS Server查询,并且提供对于无点域的匹配能力。
  • 由于无点域及本地域名往往只有本地DNS才能给出解析,因此对于该类域名应优先交给系统DNS处理。

以下是对支持方法的提案:

  • 移除对于域名是否带点的检查。
  • 提供一个新规则: dotless:<substr>。该规则用于匹配无点域名。当<substr>被设置时,无点的域名需要进一步匹配作为子串的<substr>。未设置时则匹配所有无点域名。
  • 当DNS服务器中设置了"localhost"且没有为其设置"domain"字段时,默认为其配置三条匹配规则:无点域名、.local域名与.localdomain域名。也即以下配置:
     "servers": ["localhost"]
    与以下配置等价:
    "servers": [{
       "address": "localhost",
       "domains": ["dotless:", "domain:local", "domain:localdomain"]
     }]
    
    这样只在本地有意义的域名将优先送给"localhost"查询,而非经过外部DNS然后返回大量的SERVFAIL。

参考资料

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.