重定向xboxlive系列CDN到国内节点以加速下载

重定向xboxlive系列CDN到国内节点以加速下载

肺炎肆虐地球,只能宅家打电动。

近期笔者购入AMD Ryzen™ 7 5800的Gaming PC,终于替换掉服役多年的Intel® Xeon® Processor E3-1231 v3。新主板带有蓝牙控制器能连接上吃灰已久DualShock 41,于是笔者躺在沙发上开通了微软的Xbox Game Pass Ultimate,正想将商店里面的游戏都收入囊中,看着下载进度条的速度,心想怕是Forza Horizon 5开始发售了都没能下载完。

打开Clash观察了请求记录,发现下载主要用这几个域名:

assets(1|2).xboxlive.com
xvcf(1|2).xboxlive.com

通过ipip.net的DNS工具发现,这些域名解析到的CDN节点均不在中国,且大部分为Akamai提供。以笔者多年经验,中国三大运营商均没有与Akamai节点直连,访问速度十分低。

一番搜索与请教Xbox老用户,得到一份十分珍贵的资料。正如标题所说,由于这些下载都是HTTP协议的,只要挟持并重定向到国内节点即可,由于这里host改变了,不能直接修改域名的解析,而需要利用HTTP server发起重定向。

刚好笔者的NAS在局域网的10.0.0.55上提供了HTTP/HTTPS服务,配合路由器上的DNS挟持便可以“加速”局域网内的Windows/Xbox机器。

笔者使用的是SmartDNS,其他DNS服务器配置大同小异。

address /assets1.xboxlive.com/10.0.0.55
address /assets2.xboxlive.com/10.0.0.55
address /dlassets.xboxlive.com/10.0.0.55
address /dlassets2.xboxlive.com/10.0.0.55
address /d1.xboxlive.com/10.0.0.55
address /d2.xboxlive.com/10.0.0.55
address /xvcf1.xboxlive.com/10.0.0.55
address /xvcf2.xboxlive.com/10.0.0.55

使用的HTTP server为Traefik,其他HTTP服务器大同小异。

http:
middlewares:
xbox-redirect-1:
redirectRegex:
regex: "^http://(.*).xboxlive.com/(.*)"
replacement: "http://assets1.xboxlive.cn/${2}"
permanent: true
xbox-redirect-2:
redirectRegex:
regex: "^http://(.*).xboxlive.com/(.*)"
replacement: "http://dlassets.xboxlive.cn/${2}"
permanent: true
routers:
xbox-redirect-1:
rule: "HostRegexp(`{subdomain:(assets1|assets2|d1|d2|xvcf1|xvcf2)}.xboxlive.com`)"
middlewares:
- xbox-redirect-1
service: api@internal # could be any
xbox-redirect-2:
rule: "HostRegexp(`{subdomain:(dlassets|dlassets2)}.xboxlive.com`)"
middlewares:
- xbox-redirect-2
service: api@internal # could be any

修改后刷新主机上的DNS缓存,终于能跑满笔者500Mbps的带宽了。


最后,安利微软的Xbox Game Pass Ultimate,首次试用三个月只需要HK$10。闭关锁国之后不能外出,就靠Forza Horizon 4和Microsoft Flight Simulator满足看看外面世界的欲望了。

  1. 需要配合ds4windows才能在大部分游戏中使用。

All rights reserved
Except where otherwise noted, content on this page is copyrighted.