XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
23.02k stars 3.69k forks source link

新版本,会导致twitter功能Explore,What‘s happening不正常 #1852

Closed sincereliu closed 1 year ago

sincereliu commented 1 year ago

twiter 会报这样一个错误:Something went wrong, but don’t fret — it’s not your fault. 看后台,是这个请求莫名奇妙的被404了 https://twitter.com/i/api/2/search/adaptive.json? …… 我试了了别人的免费节点,有的没有问题,有的也是这个问题。不是配置的问题,因为一直可以用,更新了新版本后就不行了,一直换到1.80也是同样的问题。 cdn+ws+tls和cdn+grpc+tls,都有这个问题,其他协议没有试过。 感觉就是推出vision之后,就出现这个问题了。

chika0801 commented 1 year ago

需要你提供你服务端的配置文件。还要说一下你用的客户端程序是什么?

sincereliu commented 1 year ago

{ "log": { "loglevel": "warning", "access": "/root/xray_log/access.log", "error": "/root/xray_log/error.log" }, "dns": { "servers": [ "https+local://dns.google/dns-query", "localhost" ] }, "routing": { "domainStrategy": "AsIs", "domainMatcher": "hybrid", "rules": [ { "type": "field", "ip": [ "geoip:private" ], "outboundTag": "block" }, { // 3.2 防止服务器直连国内 "type": "field", "ip": ["geoip:cn"], "outboundTag": "block" }, { "type": "field", "domain": [ "geosite:category-ads-all" ], "outboundTag": "block" }, { "type": "field", "protocol": [ "bittorrent" ], "outboundTag": "block" } ] }, "policy": { "levels": { "0": { "handshake": 4, "connIdle": 300, "uplinkOnly": 0, "downlinkOnly": 0, "bufferSize": 1024 } } }, "inbounds": [ { "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "", "level": 0, "email": "PC@X.seattle" } ], "decryption": "none", "fallbacks": [ { "name": "www.eeeeeee.com", "path": "/aabbcc", "dest": 3456, "xver": 1 }, { "name": "", "alpn": "h2", "dest": 8081, "xver": 1 }, { "name": "", "dest": 8080, "xver": 1 }, { "name": "diary.eeeeeeee.com", "alpn": "h2", "dest": 5004, "xver": 1 }, { "name": "diary.eeeeeee.com", "dest": 5003, "xver": 1 } ] }, "streamSettings": { "network": "tcp", "security": "tls", "tlsSettings": { "allowInsecure": false, "minVersion": "1.3", "alpn": [ "h2", "http/1.1" ], "certificates": [ { "certificateFile": "/root/xray_cert/xray.crt", "keyFile": "/root/xray_cert/xray.key" } ] } }, "sniffing": { "enabled": true, "destOverride": ["http", "tls"], "routeOnly": true } }, { "port": 3456, "listen": "127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "", "level": 0, "email": "love@example.com" } ] }, "streamSettings": { "network": "ws", "security": "none", "wsSettings": { "acceptProxyProtocol": true, "path": "/aabbcc" } } } ], "outbounds": [ { "tag": "direct", "protocol": "freedom" }, { "tag": "block", "protocol": "blackhole", "settings": { "response": { "type": "none" } } } ] }

sincereliu commented 1 year ago

我v2rayn和直接用命令行运行xray-core两种方法都试过,问题是一样的

chika0801 commented 1 year ago
"sniffing":{
                "enabled":true,
                "destOverride":[
                    "http",
                    "tls"
                ],
                "routeOnly":true
            }

配置里你把 "routeOnly":true 去掉

"sniffing":{
                "enabled":true,
                "destOverride":[
                    "http",
                    "tls"
                ]
            }

试试了。

另外要分析的话,你在服务端把日志改为Debug,访问twitter,如果你自己不会看,就把这段发上来,我们看看请求过程。 配置其它地方没什么异常。

RPRX commented 1 year ago

你们多聊聊,这几天我的感触:不处理 issue,心态自然好,反正大家会帮忙研究,很多 issue 自己就关了

chika0801 commented 1 year ago

建议把ISS区的没关的,时间久了的,都关了算了。隔壁v2rayN区只有40几个了。

RPRX commented 1 year ago

等我加了 issue templates 再处理历史问题,前天测试了一些,@yuhan6665 提醒我还有个 PR,所以这件事再议

Lather0519 commented 1 year ago

~你们多聊聊,这几天我的感触:不处理 issue,心态自然好,反正大家会帮忙研究,很多 issue 自己就关了~

~免費的"自主AI"還是要多多利用,你總不能一個人解決所有人的問題~

sincereliu commented 1 year ago
"sniffing":{
                "enabled":true,
                "destOverride":[
                    "http",
                    "tls"
                ],
                "routeOnly":true
            }

配置里你把 "routeOnly":true 去掉

"sniffing":{
                "enabled":true,
                "destOverride":[
                    "http",
                    "tls"
                ]
            }

试试了。

另外要分析的话,你在服务端把日志改为Debug,访问twitter,如果你自己不会看,就把这段发上来,我们看看请求过程。 配置其它地方没什么异常。

2023/03/25 18:18:23 [Debug] transport/internet: dialing to tcp:ton.local.twitter.com:443 2023/03/25 18:18:23 [Info] [433660287] app/proxyman/outbound: failed to process outbound traffic > proxy/freedom: failed to open connection to tcp:ton.local.twitter.com:443 > common/retry: [dial tcp: lookup ton.local.twitter.com on 127.0.0.53:53: no such host] > common/retry: all retry attempts failed

chika0801 commented 1 year ago

"https+local://dns.google/dns-query", 你把这句删了,只用系统默认DNS试试了

sincereliu commented 1 year ago

"https+local://dns.google/dns-query", 你把这句删了,只用系统默认DNS试试了

这些我都试过,我把配置改到极简,也没用,还有一个证明就是grpc方式我也用过,那个几乎不需要配置xray config,但是还是一样的问题。所以我才判断是xray里面的机制问题,而不是配置的问题。

picklefan commented 1 year ago

你v2rayn怎么配置的, 开了全局没有, 看起来是dns有问题, 127.0.0.53:53这个是什么我不是很懂, 要不你直接在windows里面把dns设置成8.8.8.8看看什么效果

chika0801 commented 1 year ago

如果是程序问题,我自己进twitter没遇到,我没看其它人说你这现象。只有靠你自己研究了。

azzvx commented 1 year ago

2023/03/25 18:18:23 [Debug] transport/internet: dialing to tcp:ton.local.twitter.com:443 2023/03/25 18:18:23 [Info] [433660287] app/proxyman/outbound: failed to process outbound traffic > proxy/freedom: failed to open connection to tcp:ton.local.twitter.com:443 > common/retry: [dial tcp: lookup ton.local.twitter.com on 127.0.0.53:53: no such host] > common/retry: all retry attempts failed

根据你这个日志,我试着查询了一下ton.local.twitter.com这个域名,8.8.8.81.1.1.14.2.2.1114.114.114.114223.5.5.5这几个常用的DNS都显示NXDOMAIN,只有119.29.29.29给出了结果,但给出的结果是假地址。 但我在访问tw的时候抓包,并没有发现有访问ton.local.twitter.com这个域名。不知道这个域名是怎么传递到服务端的。

sincereliu commented 1 year ago

如果是程序问题,我自己进twitter没遇到,我没看其它人说你这现象。只有靠你自己研究了。

嗯我再看看

qist commented 1 year ago

修改systemd-resolved

/etc/systemd/resolved.conf 
DNS=8.8.8.8    
DNSStubListener=no

# /etc/resolv.conf 就会使用你配置dns
# 重启 systemd-resolved 
systemctl restart systemd-resolved
查看本地53 端口是否监听 没有就修改成功
netstat -ulnp 
sincereliu commented 1 year ago

2023/03/25 18:18:23 [Debug] transport/internet: dialing to tcp:ton.local.twitter.com:443 2023/03/25 18:18:23 [Info] [433660287] app/proxyman/outbound: failed to process outbound traffic > proxy/freedom: failed to open connection to tcp:ton.local.twitter.com:443 > common/retry: [dial tcp: lookup ton.local.twitter.com on 127.0.0.53:53: no such host] > common/retry: all retry attempts failed

根据你这个日志,我试着查询了一下ton.local.twitter.com这个域名,8.8.8.81.1.1.14.2.2.1114.114.114.114223.5.5.5这几个常用的DNS都显示NXDOMAIN,只有119.29.29.29给出了结果,但给出的结果是假地址。 但我在访问tw的时候抓包,并没有发现有访问ton.local.twitter.com这个域名。不知道这个域名是怎么传递到服务端的。

chrome 显示这个https://twitter.com/i/api/2/search/adaptive.json? ……一大串字符,被404了。不知道为什么

qist commented 1 year ago

ton.local. 是你本地域 远程是没这个东西的。你可以修改dns search 配置

sincereliu commented 1 year ago

ton.local. 是你本地域 远程是没这个东西的。你可以修改dns search 配置

我看了下被ban的这个请求url长达1171个字符,会不会长度超标了?

sincereliu commented 1 year ago

修改systemd-resolved

/etc/systemd/resolved.conf 
DNS=8.8.8.8    
DNSStubListener=no

# /etc/resolv.conf 就会使用你配置dns
# 重启 systemd-resolved 
systemctl restart systemd-resolved
查看本地53 端口是否监听 没有就修改成功
netstat -ulnp 

我今天下午弄了一下午,应该不是dns的问题,dns 换成了8.8.8.8和8.8.8.4, 也是没用的,而且这个问题只在浏览器情况会出现。如果用twitter app是没有问题的。但是如果手机浏览器登录twitter就会报错,和在电脑是一样的。

picklefan commented 1 year ago

修改systemd-resolved

/etc/systemd/resolved.conf 
DNS=8.8.8.8    
DNSStubListener=no

# /etc/resolv.conf 就会使用你配置dns
# 重启 systemd-resolved 
systemctl restart systemd-resolved
查看本地53 端口是否监听 没有就修改成功
netstat -ulnp 

我今天下午弄了一下午,应该不是dns的问题,dns 换成了8.8.8.8和8.8.8.4, 也是没用的,而且这个问题只在浏览器情况会出现。如果用twitter app是没有问题的。但是如果手机浏览器登录twitter就会报错,和在电脑是一样的。

你这个问题我觉得8成是twitter的dns走的国内, 但是你不说你网络环境没人知道到底出了什么问题,也没有贴 error.log 里面关于 twitter.com 的DNS请求日志, 我们基本就是在算命

如果用twitter app是没有问题的。但是如果手机浏览器登录twitter就会报错,和在电脑是一样的。

比如这一段, 你这个 twitter app 是什么东西, 是 windons 的 UWP 应用, 还是 WSA 安装的 Twitter, 又或者是你手机上的 Twitter, 如果是你手机上的 Twitter, 那么你手机是通过什么方式科学上网的呢, 是手机连接 软路由透明代理 还是 Twitter 内置HTTP 代理 抑或是 手机上使用 V2RayN 并开启全局 你看你这一段话就能有这么多理解, 这让我们这些算命的很难做啊. 建议你把你的网络拓扑和上网方式说明一下, 再贴一下客户端配置, 否则我们算命的不太好猜. 其实我是想建议你去 V2Ray 那边复制一下 issue 模板的

只有电脑浏览器出问题大概率是电脑浏览器的DNS请求没有经过 Xray, 建议使用 Chrome 安装 SwitchOmega 插件, 设置 Socks5 代理, 并在 Xray 中开一个 Socks5 的入站, 然后把这个入站在 routing 里面全部 proxy. 这将排除电脑浏览器 DNS 不经过 Xray 的问题.

以下为需要增加的客户端参考配置

"inbounds": [
      {
          "tag":"socks-in",
          "port": 10808,
          "listen": "0.0.0.0",
          "protocol": "socks",
          "settings": {
              "udp": true
          }
      }
]

"routing": {
    "rules": [
    {
        "type": "field",
        "inboundTag": ["socks-in"],
        "outboundTag": "proxy"
      }
    ]
}
sincereliu commented 1 year ago

这么说吧,只要是twitter app就不会有问题,只要用浏览器登录twitter不管是手机浏览器,还是电脑的浏览器,什么浏览器也一样,chrome,edge,firefox。

翻墙工具,平时我用的是台式机我用的是v2rayN,自动配置系统代理,路由也是绕开中国大陆。手机我用的是v2rayng,路由绕开大陆。你说的omega我用着呢,因为要用命令行跑xray-core,可惜错误依旧。说明不是v2rayN的问题。

我也试过不用cdn直接裸跑,错误依旧,说明不是cdn的问题。

我也试过其他电脑结果是一样的,也排除了本机可能的网络配置问题。

sincereliu commented 1 year ago

按前面大家提示的,我也换了vps的127.0.0.53的dns,换成了8.8.8.8和8.8.8.4,但是结果也是一样。

qist commented 1 year ago

你有没多余的vps 节点 没有的话配置 warp 让twitter 走wireguard 配置模板 https://github.com/chika0801/Xray-examples/blob/main/wireguard.md 看看结果是怎样的。

picklefan commented 1 year ago

这么说吧,只要是twitter app就不会有问题,只要用浏览器登录twitter不管是手机浏览器,还是电脑的浏览器,什么浏览器也一样,chrome,edge,firefox。

翻墙工具,平时我用的是台式机我用的是v2rayN,自动配置系统代理,路由也是绕开中国大陆。手机我用的是v2rayng,路由绕开大陆。你说的omega我用着呢,因为要用命令行跑xray-core,可惜错误依旧。说明不是v2rayN的问题。

我也试过不用cdn直接裸跑,错误依旧,说明不是cdn的问题。

我也试过其他电脑结果是一样的,也排除了本机可能的网络配置问题。

说这么多跟没说一个样, 浏览器出问题说明浏览器dns根本不走xray, 要么就是分流出问题, 盲猜浏览器走的系统dns. 不要以为v2rayN配置了代理就是代理了全部, 只要是规则那就是有漏洞的. twitter这种每个人都用的东西要是有问题那肯定不止你一个

我再来算个命, 你可能有IPv6

sincereliu commented 1 year ago

https://twitter.com/i/api/2/search/adaptive.json?........ 后面一大串文字,这个请求返回403错误。感觉不是你说的dns或者路由的错误。肯定不是全局不全局的问题,请求能不能出去肯定是最先怀疑也是最先要排除的问题。我是有ipv6,但是应该没问题把 下面是这是twitter对403的解释 The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. Check that your developer account includes access to the endpoint you’re trying to use. You may also need to get your App allowlisted (e.g. Engagement API or Ads API) or sign up for access. 去vps上发这个请求,是可以收到数据的。在我的本机不行,种情况还有没有什么可能性呢?

picklefan commented 1 year ago

可能:

  1. 浏览器插件 #1737
  2. 本地 ipv6 直连
  3. Xray问题, 这个需要你找一找大概是哪个版本开始出问题了
abtahizadeh commented 1 year ago

@chika0801 @picklefan i think Twitter has a problem with some IPs (Hetzner-Germany location) i can send a test server to check the problem. https://i.postimg.cc/j2P3V1LW/problem-xray-web.jpg

https://twitter.com/i/api/2/search/adaptive.json?include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&include_ext_is_blue_verified=1&include_ext_verified_type=1&skip_status=1&cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_ext_limited_action_results=false&include_quote_count=true&include_reply_count=1&tweet_mode=extended&include_ext_views=true&include_entities=true&include_user_entities=true&include_ext_media_color=true&include_ext_media_availability=true&include_ext_sensitive_media_warning=true&include_ext_trusted_friends_metadata=true&send_error_codes=true&simple_quoted_tweet=true&q=test&query_source=typed_query&count=20&requestContext=launch&pc=1&spelling_corrections=1&include_ext_edit_control=true&ext=mediaStats%2ChighlightedLabel%2ChasNftAvatar%2CvoiceInfo%2CbirdwatchPivot%2Cenrichments%2CsuperFollowMetadata%2CunmentionInfo%2CeditControl%2Cvibe

sincereliu commented 1 year ago

应该是xray自己的问题,等等看吧。

picklefan commented 1 year ago

既然大家都是用Xray-core, 你得先告诉我们如何复现这个问题, 比如点进 Twitter 的 Explore, 然后如何操作会出现什么现象, 如果我们无法复现这个现象, 说明这跟 Xray-core 的关系不大

abtahizadeh commented 1 year ago

Since everyone is using Xray-core, you have to tell us how to reproduce this problem first, such as clicking on Twitter’s Explore, and then how to operate what will happen. If we cannot reproduce this phenomenon, it means that it is related to Xray-core doesn't matter

This problem occurs with Hetzner datacenter IPs

Hashtag or quote tweets are not seen when searching.

https://twitter.com/search?q=%23Dogecoin&src=trend_click&vertical=trends I have emailed you a configuration of this server as an example.

picklefan commented 1 year ago

https://twitter.com/search?q=%23Dogecoin&src=trend_click&vertical=trends

This page loads fine on my browser, and there is no adaptive.json requested. Since my IP does not belong to Hetzner datacenter, what you suggest that the cause of the problem is IP is very convincing. Thank you for the information, and I think this issue should be closed by marking your answer as solution. @abtahizadeh

sincereliu commented 1 year ago

ip的问题?我在美国西雅图,意思我换一个地方看看?

picklefan commented 1 year ago

ip的问题?我在美国西雅图,意思我换一个地方看看?

你不会套个warp 吗

sincereliu commented 1 year ago

一直没有搞一直以为想看奈飞才需要弄 前几天看见newbing可以通过warp访问,就有点想弄了,看你这麽说,必须弄一弄了 。

sincereliu commented 1 year ago

ip的问题?我在美国西雅图,意思我换一个地方看看?

你不会套个warp 吗 不过我还是有疑问的,因为一直能正常使用,我前段时间唯一做的事情,就是升级了xray,然后twitter就出现了哪些问题。

chika0801 commented 1 year ago

我一直想说楼主遇到了,多找几个vps保持配置文件一样,看现象是否复现来排查

picklefan commented 1 year ago

ip的问题?我在美国西雅图,意思我换一个地方看看?

你不会套个warp 吗 不过我还是有疑问的,因为一直能正常使用,我前段时间唯一做的事情,就是升级了xray,然后twitter就出现了哪些问题。

这就更简单了, 你把版本退回去看看不就知道问题到底是不是 Xray 了吗? 这个世界一直都是在变化的, 你以为只有 Xray 是变量, 也就是说只有你改变的才叫变量, 那你是觉得只要你什么都不干马斯克就不买 Twitter 了? 遇到问题如果不能瞬间定位根本原因, 那你至少要学会用排除法来 narrow down 不要老想着算命, 你来算命还把带个防毒面具一句话不说, 那我们只能瞎几把说了

还有这里不是算命的地方, 以后还有类似算命需求没人会回复了

sincereliu commented 1 year ago

和你对话就发现你是个急性子,会没有异性缘的,哈哈。你说没错,加了wrap全部正常了。谢谢你的帮助

sincereliu commented 1 year ago

我一直想说楼主遇到了,多找几个vps保持配置文件一样,看现象是否复现来排查

@picklefan 小朋友给了很大帮助,为什么说他是小朋友,因为被他鄙视了好几天,我要找补回来,哈哈,按他说的加了wrap完美搞定。