2dust / v2rayN

A GUI client for Windows, support Xray core and v2fly core and others
https://1.2345345.xyz
GNU General Public License v3.0
67.7k stars 11.28k forks source link

企业微信 httpdns 解析到了美国服务器 #2457

Closed c332030 closed 2 years ago

c332030 commented 2 years ago

如下日志,企业微信域名(i.work.weixin.qq.com)的策略是 direct,但是企业微信通过内部 httpdns 解析时是通过 proxy 解析的,local_ip 是我服务器的 ip,httpdns 解析到的 ip 在美国,导致企业微信图片经常发送慢或者失败

客户端是 v2rayN,路由策略是:https://github.com/2dust/v2rayCustomRoutingList/blob/master/custom_routing_rules_whitelist

预期行为

企业微信域名 direct 策略时访问 国内 服务器

实际行为

企业微信域名 direct 策略时访问 美国 服务器

复现方法

  1. 路由策略是:https://github.com/2dust/v2rayCustomRoutingList/blob/master/custom_routing_rules_whitelist
  2. 打开企业微信

日志信息,位置在当前目录下的guiLogs

v2ray 日志

``` 配置成功 [] [VLESS] xtls(proxy***com:443) 启动服务(2022-7-6 15:07:20)... Xray 1.5.5 (Xray, Penetrates Everything.) Custom (go1.18.1 windows/amd64) A unified platform for anti-censorship. 2022/07/06 15:07:20 [Info] infra/conf/serial: Reading config: E:\software\comm\connect\v2rayN\app\config.json 2022/07/06 15:07:21 [Warning] core: Xray 1.5.5 started 2022/07/06 15:07:21 127.0.0.1:59902 accepted //vscode-sync.trafficmanager.net:443 [http -> proxy] 2022/07/06 15:07:21 127.0.0.1:59901 accepted //mtalk.google.com:5228 [http -> proxy] 2022/07/06 15:07:21 127.0.0.1:59903 accepted //vscode-sync.trafficmanager.net:443 [http -> proxy] 2022/07/06 15:07:22 127.0.0.1:59907 accepted https://dc.services.visualstudio.com/api/profiles/AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217/appId [http -> proxy] 2022/07/06 15:07:22 127.0.0.1:59918 accepted //wwcdn.weixin.qq.com:443 [http -> direct] 2022/07/06 15:07:22 127.0.0.1:59922 accepted http://182.254.116.117/d?dn=80c228514177bf94d6216e5c9e9b638d5c179fc7b71c7b76&id=2&ttl=1&clientip=1&type=a [http -> proxy] 2022/07/06 15:07:23 127.0.0.1:59925 accepted //localhost:50052 [http -> direct] 2022/07/06 15:07:23 127.0.0.1:59926 accepted //localhost:50051 [http -> direct] 2022/07/06 15:07:24 [Warning] [1942578197] proxy/http: failed to read response from 182.254.116.117 > io: read/write on closed pipe 2022/07/06 15:07:24 127.0.0.1:59932 accepted http://182.254.118.119/d?dn=80c228514177bf94d6216e5c9e9b638d5c179fc7b71c7b76&id=2&ttl=1&clientip=1&type=a [http -> proxy] 2022/07/06 15:07:25 127.0.0.1:59934 accepted //i.work.weixin.qq.com:443 [http -> direct] 2022/07/06 15:07:26 127.0.0.1:59941 accepted https://mobile.events.data.microsoft.com/collect/v1 [http -> proxy] 2022/07/06 15:07:26 [Warning] [2725050104] proxy/http: failed to read response from mobile.events.data.microsoft.com > io: read/write on closed pipe 2022/07/06 15:07:27 127.0.0.1:59947 accepted //alive.github.com:443 [http -> proxy] 2022/07/06 15:07:28 127.0.0.1:59951 accepted //i.work.weixin.qq.com:443 [http -> direct] 2022/07/06 15:07:28 127.0.0.1:59956 accepted http://182.254.116.117/d?dn=98298614c1fedbb699c46225bf26d906&id=2&ttl=1&clientip=1&type=a [http -> proxy] 2022/07/06 15:07:29 127.0.0.1:59962 accepted //wework.qpic.cn:443 [http -> direct] 2022/07/06 15:07:29 127.0.0.1:59968 accepted //i.work.weixin.qq.com:443 [http -> direct] 2022/07/06 15:07:29 127.0.0.1:59965 accepted //i.work.weixin.qq.com:443 [http -> direct] ```

企业微信日志 C:\Users\Administrator\AppData\Roaming\Tencent\WXWork\Log\HttpDns

``` 2022-07-06 15:07:22 switch to use http dns! 2022-07-06 15:07:22 fetch bgp ip list ok, url: https://wwcdn.weixin.qq.com/zh_CN/app_bgp.js, ip list:[182.254.116.117,182.254.118.119], use httpdns: 1 2022-07-06 15:07:22 switch to use http dns! 2022-07-06 15:07:24 httpdns resolve host i.work.weixin.qq.com failed. 2022-07-06 15:07:25 httpdns resolve host i.work.weixin.qq.com ok, bgp_ip: 182.254.118.119, local_ip: 144.34.162.25, IP:[49.51.190.133,49.51.190.151] cost: 796ms. 2022-07-06 15:07:28 httpdns resolve host i.work.weixin.qq.com hit cache, ttl=597 2022-07-06 15:07:29 httpdns resolve host wework.qpic.cn ok, bgp_ip: 182.254.116.117, local_ip: 144.34.162.25, IP:[wework.qpic.cn.sched.legopic1.tdnsv6.com.] cost: 805ms. 2022-07-06 15:07:29 httpdns resolve host i.work.weixin.qq.com hit cache, ttl=596 ```

环境信息(客户端请升级至最新正式版)

额外信息(可选)

c332030 commented 2 years ago

没有在v2rayn 里发现 httpdns 的请求日志

xincheng213618 commented 2 years ago

2022/07/06 15:07:24 127.0.0.1:59932 accepted http://182.254.118.119/d?dn=80c228514177bf94d6216e5c9e9b638d5c179fc7b71c7b76&id=2&ttl=1&clientip=1&type=a [http -> proxy]

企业微信,解析IP的时候,用的是IP地址,这个地址是使用代理去访问的,所以拿到的是代理的ip

xincheng213618 commented 2 years ago

问题是上传图片的地址也是IP,都添加在直连之内,好像会很好,不知道有没有好心人整理一下,腾讯的ip

xincheng213618 commented 2 years ago

2022-07-06 15:07:22 fetch bgp ip list ok, url: https://wwcdn.weixin.qq.com/zh_CN/app_bgp.js, ip list:[182.254.116.117,182.254.118.119], use httpdns: 1 企业微信在启动的时候,会先往这个接口发送一个请求,获取服务器ip,然后往这个ip中通过访问请求地址,来判断用户的ip地址

c332030 commented 2 years ago

2022/07/06 15:07:24 127.0.0.1:59932 accepted http://182.254.118.119/d?dn=80c228514177bf94d6216e5c9e9b638d5c179fc7b71c7b76&id=2&ttl=1&clientip=1&type=a [http -> proxy]

企业微信,解析IP的时候,用的是IP地址,这个地址是使用代理去访问的,所以拿到的是代理的ip

image 规则l里有条这个,为啥没有生效,是不全吗

xincheng213618 commented 2 years ago

这个不清楚

c332030 commented 2 years ago

这个不清楚

谢啦,我先写把这两个 ip 写死在 direct 里

c332030 commented 2 years ago

我错了,企业微信访问国内一样发不出图片。真是受够了,文字出去了图片没出去

liyang-lomo commented 1 year ago

image

把这两个ip改为直连就没事了,企业微信是真的狗啊

ghost commented 1 year ago

image