On a computer: proxy chain in Clash Verge Rev
Add an extend script to your Clash Verge Rev profile so traffic goes through your usual node first and leaves from the static IP
On this page
This guide is for people who already use Clash Verge Rev with a subscription (profile) imported and working. Once set up, the sites you choose go this way: your computer → your usual node → static IP → website.
If you don’t have it yet, download the version for your system from the official Clash Verge Rev releases page on GitHub. It’s free and open source.
The steps below use an Extend Script: paste a script and change one line. After that you can pick Static IP in any proxy group, and it survives profile updates. If you’d rather not touch a script, Clash Verge Rev’s built-in chain proxy mode lets you set it up by clicking; see the illustrated steps in how to set up a proxy chain in Clash Verge Rev. Other Clash apps built on the mihomo core work the same way: give the static IP node a dialer-proxy that points to one of your nodes or a node group.
Setup
Copy the IP
In My services → Static IPs, set Format to ip:port:username:password and press Copy on that IP.
Open the extend script
In Clash Verge Rev, click Profiles on the left, right-click the profile you are using and choose Extend Script.
Paste the script and fill in your IP
Delete everything in the editor, press Copy at the top right of the script below and paste it in, then replace 11.22.33.44:8000:user01:password in quotes on the second line with the IP you just copied (keep the quotes). Click Save.
// Only change the text in quotes on the next line: paste the ip:port:username:password from My services
const STATIC_IP = "11.22.33.44:8000:user01:password";
function main(config) {
const parts = STATIC_IP.trim().split(":");
if (parts.length < 4) throw new Error("STATIC_IP should look like ip:port:username:password");
const password = parts.pop();
const username = parts.pop();
const port = Number(parts.pop());
const server = parts.join(":");
const NAME = "Static IP";
const VIA = "Static IP upstream";
const builtin = ["DIRECT", "REJECT", "REJECT-DROP", "PASS"];
config.proxies = config.proxies || [];
config["proxy-groups"] = config["proxy-groups"] || [];
config.proxies.push({
name: NAME,
type: "socks5",
server: server,
port: port,
username: username,
password: password,
udp: true,
"dialer-proxy": VIA,
});
config["proxy-groups"].forEach(function (g) {
const list = g.proxies || [];
const onlyBuiltin = list.length > 0 && list.every(function (p) { return builtin.indexOf(p) >= 0; });
if (g.type === "select" && !onlyBuiltin) g.proxies = [NAME].concat(list);
});
config["proxy-groups"].push({
name: VIA,
type: "url-test",
"include-all": true,
"exclude-filter": "^" + NAME + "$",
url: "https://www.gstatic.com/generate_204",
interval: 300,
});
return config;
}
Pick Static IP on the Proxies page
Click Proxies on the left and pick Static IP in the proxy group that should use it:
- If your subscription has a group just for Claude, AI or OpenAI (names vary by provider), pick it there, and only those sites use the static IP.
- If not, pick it in the main group (usually the first one, such as Proxy or Node Select), and every site that goes through the proxy leaves from the static IP.
Check
Open ipinfo.io in your browser. If it shows your static IP, you’re done. (If you picked it in a dedicated group, check with a site that group handles.)
The script does three things: adds a node called Static IP; puts it at the top of every selectable proxy group; and adds a Static IP upstream group that automatically picks the fastest working node in your subscription as the first hop (info entries such as “traffic left” or “expires on” can’t connect, so they are never picked). You never need to choose anything in Static IP upstream yourself.
If your IP only has an HTTP port, or two separate ports
The script connects over SOCKS5. Set Format to socks5://… and copy once to check. If the copied line doesn’t start with socks5://, the IP only has an HTTP port: change type: "socks5", in the script to type: "http", and delete the udp: true, line. If it does start with socks5:// but its port differs from the one in ip:port:username:password, put the socks5:// port on the second line.
Good to know
- Profile updates don’t undo it: the script belongs to this profile and re-adds Static IP every time the profile updates. If you switch to another profile, add the script there too.
- New IP: open Extend Script, change the second line and save.
- Rule and Global modes: in Rule mode, pick it as in step 4. In Global mode, pick Static IP under GLOBAL and all traffic goes through it.
- Claude Code in a terminal and other command-line tools ignore the system proxy. Turn on Tun Mode in Clash Verge Rev’s Settings (the first time, it asks you to install service mode; follow the prompt), or set
HTTPS_PROXY=http://127.0.0.1:7897in the terminal (use the Mixed Port shown in Clash Verge Rev’s settings). - Several IPs on one computer, one per account: an anti-detect browser is easier; see In an anti-detect browser.
If something goes wrong
- “Script syntax error, changes reverted” or “Script error, changes reverted” when saving: usually a quote was deleted or the IP wasn’t pasted in full. Paste the whole script again and change the second line.
- No Static IP on the Proxies page: make sure you edited the profile you are using (its card is selected), then wait a few seconds after saving.
- Static IP stopped working after you turned Clash Verge Rev’s chain proxy mode on and off again: turning it off clears the upstream setting from the config. On the Profiles page, click the current profile again so the config is rebuilt.
- Pages won’t load after picking Static IP, or the check still shows your node’s IP: see Static IP won’t connect or shows the wrong IP.
Updated 2026-12-03 · 3 min read
Was this article helpful?
Still stuck?
Submit a ticket or contact support and we’ll get back to you soon.