Get a VPS server with a 15% discount
Sale ends in
00Days
:
00Hours
:
00Minutes
:
00Seconds

Proxying Specific Websites with V2RayN

In this article, we will look at the following task: how to configure a VPN connection so that it is used only for specific services? In other words, how to make most traffic to websites and applications go directly, while only traffic to selected resources is routed through the VPN?

We will demonstrate this using the 3X-UI VPN panel. First, you need to install and configure it on a VDS server by following this guide. However, do not rush to install the client application on your computer or smartphone yet — simply copy the connection configuration. It is a single line that starts with "vless://".

For Windows, install the V2RayN application. You can download it from the official repository using this link. Select the "With-Core" version.

Selecting the V2RayN With-Core version

Download and extract the archive to your desktop. You will see the following files. Run v2rayN.exe.

V2RayN files after extracting the archive

In the application window, click the "Servers" button. Then click "Importing Share Links...". The configuration address starting with "vless://" must already be copied to the clipboard.

Importing a share link in V2RayN

The server has been added. Click "Settings" -> "Routing Setting".

Opening Routing Setting in V2RayN

Select "Advanced Function" -> "Add".

Adding an advanced routing function

Enter any name in the "Remarks" field.

Remarks field in routing settings

Right-click in the area marked by the black square. A menu will open — select "Add Rule".

Adding a routing rule in V2RayN

In the new rule creation window, select the "Proxy" type. In the "Domain" field, specify all domains for which you want to use the VPN.

Creating a Proxy rule for selected domains

For example, to make Discord work through the VPN, you need to specify these domains. For YouTube, use this list. As an example, we will specify the whatismyip.com service to verify that our IP address is actually changing. Click "Confirm" to save the rule.

Next, create another rule in the same way. This time, select the "Direct" proxy type. In the domains block, enter the following expression

Save your changes.

Creating a Direct rule for all other domains

The first rule we created will send encrypted VPN traffic only to the specified domains — in our case, to whatismyip.com. Thanks to the second rule, all other websites will use your "clean" direct traffic without the VPN. Save all the settings.

Saving routing rules in V2RayN
Saved routing rules in V2RayN

For the "Routing" parameter, select the profile you created using the steps above. Set the "System proxy" parameter to "Set system proxy", then click "Enable Tun" to start the tunnel.

Enabling system proxy and TUN in V2RayN

Time to check the result. On one website, your original IP address is shown.

Checking the original IP address without VPN

Meanwhile, on whatismyip.com, which we added to the proxy list, the IP address of the VPN server is displayed instead.