How to Configure V2RayN for Automatic System Proxy

Enable V2RayN's "自动配置系统代理" (Automatic System Proxy) feature from the tray icon to register a PAC script with Windows, forcing all system-compliant applications to route traffic through your selected proxy node without manual browser configuration.

V2RayN is a Windows client for the V2Ray networking platform that supports VMess, Shadowsocks, HTTP, and SOCKS5 protocols. According to the bannedbook/fanqiang repository documentation, configuring automatic system proxy allows the entire operating system to use your V2Ray connection transparently. This guide walks through the exact steps derived from the source documentation, including prerequisites, UI navigation, and advanced chain-proxy setups.

Prerequisites for V2RayN Automatic Proxy Configuration

Before enabling automatic system proxy, verify your environment meets the runtime requirements.

V2RayN requires Microsoft .NET Framework 4.8 or newer to function correctly on Windows systems. As documented in /windows/V2RayN.md#L7-L10, ensure this runtime is installed before launching the application to avoid initialization errors. The client will not properly register system proxy settings without this dependency.

Step-by-Step Configuration Process

Complete these three phases to activate automatic system proxy routing.

Install the Runtime and Launch V2RayN

Download the latest V2RayN release and extract it to a permanent directory. Since V2RayN is a portable application, it does not require traditional installation, but it relies on the .NET Framework being present in the Windows system path. Launch v2rayN.exe to initialize the GUI and populate the configuration directory.

Import Subscriptions or Add Nodes Manually

V2RayN requires at least one active node before system proxy can function. Navigate to the 订阅设置 (Subscription Settings) interface to import a V2Ray or Shadowsocks subscription link, or manually add individual server nodes.

As specified in /windows/V2RayN.md#L31-L40, use the subscription menu to paste your provider's URL, then click Update to fetch the server list. Alternatively, right-click in the server list panel and select Add [VMess] server to input connection parameters manually, including address, port, UUID, and alterId for VMess protocols.

Enable Automatic System Proxy via the Tray Icon

Once nodes are loaded, activate the system-wide proxy:

  1. Right-click the V2RayN tray icon in the Windows system tray.
  2. Check the option labeled "自动配置系统代理" (Automatic System Proxy).
  3. In the main V2RayN window, right-click your desired node and select "系统代理/自动配置系统代理".

According to /windows/V2RayN.md#L46-L49, this action registers a PAC (Proxy Auto-Configuration) script with the Windows Internet Settings. Applications that respect system proxy settings—including Microsoft Edge, Google Chrome, and Internet Explorer—will automatically route their traffic through the selected V2RayN node without additional configuration.

Advanced: Configuring Chain Proxies with System Proxy

For scenarios requiring traffic to hop through an external residential or upstream proxy before reaching the V2Ray server, V2RayN supports chain proxies (链式代理). When configured, enabling automatic system proxy causes the entire system to use the chained route instead of a direct connection.

Setting Up the Chain

First, create both the primary V2Ray node and the residential proxy node:

  1. Add your standard V2Ray server as described above.
  2. Add a residential or upstream proxy node (SOCKS5 or HTTP) through 配置项 (Configuration Items).
  3. Navigate to the chain proxy configuration section as detailed in /如何使用v2rayN配置链式代理.md#L28-L55.

Create a new chain configuration and add both nodes as sub-items, placing the V2Ray node first and the residential proxy second. As noted in /如何使用v2rayN配置链式代理.md#L42-L55, the traffic flow becomes: Application → V2RayN → V2Ray Node → Residential Proxy → Destination.

Once the chain node is activated in the server list, enable "自动配置系统代理" from the tray icon. Windows will now direct all system proxy traffic through the entire chain.

Understanding the Configuration File Structure

V2RayN writes proxy settings to config.json in the application directory. When automatic system proxy is enabled, the autoProxy field in the global configuration section is set to true.

Below is the JSON structure representing a typical configuration with automatic proxy enabled and an optional chain setup:

{
  "strategy": "tcp",
  "index": 0,
  "global": {
    "autoProxy": true
  },
  "servers": [
    {
      "remarks": "V2Ray-Free-Node",
      "address": "example.v2ray.com",
      "port": 443,
      "id": "xxxxxxxxxxxxxxxxxxxx",
      "alterId": 64,
      "security": "auto",
      "type": "vmess"
    },
    {
      "remarks": "Residential-SOCKS5",
      "address": "socks5.proxy.com",
      "port": 1080,
      "username": "user",
      "password": "pass",
      "type": "socks5"
    }
  ],
  "chains": [
    {
      "name": "Chain-V2Ray-to-SOCKS5",
      "nodes": ["V2Ray-Free-Node", "Residential-SOCKS5"]
    }
  ]
}

The global.autoProxy: true value corresponds to the "自动配置系统代理" setting in the UI. Modifying this file manually requires a V2RayN restart to take effect, though the tray icon method applies changes immediately.

Verifying the System Proxy Is Active

After enabling automatic configuration, verify that Windows has registered the proxy:

  • Open Windows SettingsNetwork & InternetProxy.
  • Under Automatic proxy setup, the "Use setup script" toggle should be On, pointing to a local PAC file path generated by V2RayN.
  • Visit an IP-checking website in a browser; the displayed IP should match your V2Ray server or chain exit node, not your ISP-assigned address.

Summary

  • V2RayN requires .NET Framework 4.8 before it can register system proxy settings, as documented in /windows/V2RayN.md#L7-L10.
  • Enable "自动配置系统代理" from the tray icon to inject a PAC script into Windows Internet Settings, routing all compliant application traffic through V2RayN.
  • Configure chain proxies by creating residential nodes and chaining them to V2Ray nodes, then activating the chain before enabling system proxy.
  • The config.json file uses "autoProxy": true in the global section to persist the automatic system proxy setting between sessions.
  • Verification involves checking Windows Proxy settings for an active PAC script and confirming IP address changes in browsers.

Frequently Asked Questions

What is automatic system proxy in V2RayN?

Automatic system proxy is a V2RayN feature that registers a PAC (Proxy Auto-Configuration) script with the Windows operating system. When enabled via the tray icon's "自动配置系统代理" option, it configures Windows to automatically determine which traffic should route through the V2RayN local proxy (typically SOCKS5 port 10808 or HTTP port 10809) without manual browser configuration.

Does V2RayN automatic proxy work with all applications?

No, only applications that respect Windows system proxy settings will use the automatic configuration. Modern browsers like Chrome, Edge, and Firefox (when set to "Use system proxy settings") will route traffic through V2RayN. However, command-line tools, some gaming clients, and applications with hardcoded network stacks may require manual proxy configuration or the use of TUN/TAP interfaces instead of system proxy mode.

How do I disable automatic system proxy in V2RayN?

Right-click the V2RayN tray icon and uncheck "自动配置系统代理" (Automatic System Proxy). This removes the PAC script registration from Windows Internet Settings immediately. Alternatively, selecting "系统代理/清除系统代理" (Clear System Proxy) from the server list context menu achieves the same result, restoring direct internet connections for all applications.

Can I use automatic system proxy with chain proxies?

Yes, chain proxies are fully compatible with automatic system proxy. First configure the chain by creating a residential node and linking it to your V2Ray node as described in /如何使用v2rayN配置链式代理.md#L28-L55. Activate the chain node in V2RayN's server list, then enable "自动配置系统代理". The system proxy will route all traffic through the entire chain: Local Machine → V2RayN → V2Ray Server → Residential Proxy → Destination.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →