Routing Gemini Through WARP with XrayR
This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文
On my dmit VPS, accessing chatgpt and grok works fine, but gemini often shows "Please check your internet connection and try again." It shouldn't be an IP issue, so this is a good chance to try routing traffic through warp.
How It Works
Configure a Custom Outbound in XrayR pointing to a Cloudflare WARP tunnel, then use Custom Routing to send requests for specific domains (such as Gemini and Netflix) through WARP, bypassing regional restrictions on the VPS's native IP.
1. Prerequisites
-
Environment: XrayR server installed.
-
WARP account details: Valid WARP configuration parameters that support the WireGuard protocol (
privateKey,address,reserved, etc.). -
Core support: Ensure the Xray-core version used by XrayR supports the
wireguardprotocol (recommended version > 1.5.0).
2. Using the Script: Getting Configuration Details
Although you can install wireproxy (a local SOCKS5 proxy) using the script, direct WireGuard mode is recommended for the best performance.
- Run the WARP script (the fscarmen script is recommended):
wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh
-
Steps:
-
Select option 13 (install wireproxy).
-
It then seems to populate the warp details in xrayr automatically.
-
3. Key XrayR Configuration Files
1. Edit config.yml (Main Configuration)
Make sure the custom file paths are enabled in the Nodes section by removing the leading # comment markers:
YAML
CustomOutboundConfigPath: /etc/XrayR/custom_outbound.json
CustomRoutingConfigPath: /etc/XrayR/route.json
2. Edit custom_outbound.json (Outbound Configuration)
This step should already have been completed automatically.
Add an outbound tagged warp to this file. Be sure to replace the private key and address with your own:
[
{
"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" }
]
If you also tried the socks method like I did, the default port is 40000, and you need to add it manually
Add this configuration to custom_outbound.json:
{
"tag": "warp_out",
"protocol": "socks",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 40000
}
]
}
}
3. Edit route.json (Routing Configuration)
This step needs adjustments; the automatically generated configuration has issues.
Important: You must route all google services through WARP. Otherwise, the services will use different IPs, and google will block the traffic.
Mind the priority: The warp rule must be placed at the top.
{
"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"
}
]
}
4. Testing and Verification
1. Restart the Service
After editing all the files, you must restart XrayR:
XrayR restart
2. Check the Logs
Use the following command to monitor traffic routing in real time. If you see the -> warp tag when accessing Google/Gemini, it is working:
XrayR log | grep "warp"
Example of a successful log entry:
accepted tcp:www.google.com:443 [Vless_... -> warp]
3. Test in the Browser
-
Access Gemini: Open gemini.google.com. If no regional restriction message appears, it is working.
-
Check the xrayr logs
Last updated 2026-01-23
Comments 0