我的dmit, 访问chatgpt, grok这些都没问题, gemini总是经常显示"请检查互联网连接,然后重试", 按理来说应该不是ip的问题, 正好试试warp分流的方法
核心原理
通过在 XrayR 中配置 自定义出站 (Custom Outbound) 指向 Cloudflare WARP 隧道,并配合 自定义路由 (Custom Routing),将特定域名(如 Gemini、Netflix)的请求定向到 WARP 发出,从而绕过 VPS 原生 IP 的地区限制。
一、 前提条件
-
环境:已安装 XrayR 服务端。
-
WARP 账户信息:拥有有效且支持 WireGuard 协议的 WARP 配置参数(
privateKey、address、reserved等)。 -
核心支持:确保 XrayR 使用的 Xray-core 版本支持
wireguard协议(建议版本 > 1.5.0)。
二、 脚本操作:获取配置信息
虽然可以通过脚本安装 wireproxy(本地 SOCKS5 代理),但为了最佳性能,推荐使用 WireGuard 直连模式。
- 运行 WARP 脚本(推荐 fscarmen 脚本):
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh
-
操作步骤:
-
选择选项 13(安装 wireproxy)。
-
然后好像会自动填充warp信息到xrayr
-
三、 XrayR 关键配置文件设置
1. 修改 config.yml (主配置)
确保 Nodes 部分开启了自定义文件路径引用,取消前面的 # 注释:
YAML
CustomOutboundConfigPath: /etc/XrayR/custom_outbound.json
CustomRoutingConfigPath: /etc/XrayR/route.json
2. 修改 custom_outbound.json (出站配置)
这一步按理来说已经自动完成了
在此文件中添加 warp 协议标签。注意替换你自己的私钥和地址:
[
{
"tag": "warp",
"protocol": "wireguard",
"settings": {
"secretKey": "你的私钥",
"address": ["172.16.0.2/32", "你的V6地址/128"],
"mtu": 1280,
"reserved": [45, 85, 21],
"peers": [
{
"publicKey": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
"endpoint": "engage.cloudflareclient.com:2408",
"keepAlive": 25
}
]
}
},
{ "tag": "IPv4_out", "protocol": "freedom" }
]
如果你跟我一样也尝试了socks方法, 默认是40000端口, 那就需要手动添加了
那么在custom_outbound.json添加这个配置:
{
"tag": "warp_out",
"protocol": "socks",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 40000
}
]
}
}
3. 修改 route.json (路由配置)
这一步需要调整, 自动的有问题
重要: 必须分流所有google服务, 不然各个服务的ip不一样, google会拦截.
注意优先级: 必须将 warp 规则放在最上方。
{
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"outboundTag": "warp",
"domain": [
"geosite:google"
]
},
{
"type": "field",
"outboundTag": "block",
"ip": [
"geoip:private"
]
},
{
"type": "field",
"outboundTag": "block",
"protocol": [
"bittorrent"
]
},
{
"type": "field",
"outboundTag": "IPv4_out",
"domain": [
"geosite:cn"
]
},
{
"type": "field",
"outboundTag": "IPv4_out",
"ip": [
"geoip:cn"
]
},
{
"type": "field",
"outboundTag": "IPv4_out",
"network": "udp,tcp"
}
]
}
四、 测试与验证
1. 重启服务
修改完所有文件后,必须重启 XrayR:
XrayR restart
2. 日志验证
使用以下命令实时查看流量走向。如果你访问 Google/Gemini,看到 -> warp 标签即代表成功:
XrayR log | grep "warp"
成功示例日志:
accepted tcp:www.google.com:443 [Vless_... -> warp]
3. 网页端测试
-
访问 Gemini:打开 gemini.google.com,若无地区限制提示则成功。
-
看xrayr日志
