# Proxy for Specific Websites (V2RayN)

In this article, we will discuss how to set up a VPN connection so that it is used only for specific services. In other words, how to ensure that most websites and apps use a direct connection, while only designated resources route data through the VPN?

We’ll demonstrate this using the 3X-UI VPN panel. First of all, you need to install and configure it on a VDS server using [the following guide](https://wiki.spacecore.pro/en/vpn-and-privacy/3x-ui-installation). However, don’t rush to install the program on your computer or smartphone yet; simply copy the configuration for connection. It looks like a string starting with “vless\://”.

For Windows, install the V2RayN program. You can download it from [the official repository](https://github.com/2dust/v2rayN/releases). Choose the “With-Core” version.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FdJIPoVAfkgrfiEJtkqaP%2Fimage.png?alt=media&#x26;token=3f67a92a-f57f-4e1c-9797-7ad9f186af63" alt=""><figcaption></figcaption></figure>

Download and unpack the archive on your desktop. You will see the following files. Run v2rayN.exe

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FW29sH38zNm4CdfCItiNf%2Fimage.png?alt=media&#x26;token=764d337f-fa09-442c-bc1a-70bb4fbe5961" alt=""><figcaption></figcaption></figure>

In the program window that opens, click the Servers button. Then click “Importing Share Links…”. The config address, starting with “vless\://”, should be copied to the clipboard.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FIOnDhv9Z8AjmfJ93PTBl%2Fv2rayN_FA2FrPL0up.png?alt=media&#x26;token=81a01401-7840-4020-aeca-e88c9d6d01ac" alt=""><figcaption></figcaption></figure>

The server is now added. Click Settings -> Routing Setting.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FS5hAbO93e7BoBf0ahyQt%2Fv2rayN_RpWwbQpgHc.png?alt=media&#x26;token=e2a0af38-72ee-4e1b-8cdd-e2d18929dd49" alt=""><figcaption></figcaption></figure>

Select Advanced Function -> Add.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FgHn135yUGOZnOhT4bX64%2Fv2rayN_QheIWa4Skt.png?alt=media&#x26;token=74afabd4-a3f4-41f0-ba29-86196ff897cc" alt=""><figcaption></figcaption></figure>

Enter any name in the “Remarks” field.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FzSwNdap9cwoHmdb7ak7I%2Fimage.png?alt=media&#x26;token=17708c24-fb15-47cc-8f98-6c8c9eebb096" alt=""><figcaption></figcaption></figure>

Right-click in the black square area. A menu will appear, select “Add Rule”.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2Fy8CRZSlE7OwndwIwFJai%2Fimage.png?alt=media&#x26;token=65e36f81-073d-4dc7-baf5-de0c682f7102" alt=""><figcaption></figcaption></figure>

In the window for creating a new rule, choose the “Proxy” type. In the “Domain” field, enter all the domains you want to route through the VPN.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2F6rL5iMkw6Wf7BdqPnYVb%2Fimage.png?alt=media&#x26;token=20bc2c62-92e8-449c-a4eb-1b302e9c33a2" alt="" width="563"><figcaption></figcaption></figure>

For example, to have Discord use the VPN, you need to list [the following domains](https://github.com/v2fly/domain-list-community/blob/master/data/discord). For YouTube, use [this link](https://github.com/v2fly/domain-list-community/blob/master/data/youtube). As an example, we will use the service whatismyip.com to check that our IP address indeed changes. Click Confirm to save.

Next, create another rule in the same way. This time, select the proxy type “Direct”. In the domain block, enter the following expression `regexp:\.*$`.&#x20;

Save.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FoT1ameZaiDtIaN7D77TX%2Fimage.png?alt=media&#x26;token=fbf28266-17a4-43ee-99d3-ba287f762083" alt="" width="563"><figcaption></figcaption></figure>

The first rule we created will send protected VPN traffic only to the specified domains. In our case, to whatismyip.com. Thanks to the second rule, all other websites will receive our “clean” traffic without using the VPN. Save everything.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FmZGziVPIwPu8G7DEmApT%2Fimage.png?alt=media&#x26;token=0fc03f68-d7fe-4479-85df-5acb6595a3c9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2Fz11Md06gml9Hf6WS38Bz%2Fimage.png?alt=media&#x26;token=3d76ada7-f187-47ae-997c-51e37d1006ba" alt=""><figcaption></figcaption></figure>

For the “Routing” parameter, select the one you created following the above instructions. Set the “System proxy” parameter to “Set system proxy,” then click “Enable Tun” to start the tunnel.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FXKYt5zf721wCPrbpuu36%2Fimage.png?alt=media&#x26;token=eb161ec3-801b-420c-9f0a-b3ce8e6bef49" alt=""><figcaption></figcaption></figure>

Check the result. On one site, our original address is displayed.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FELA9eSGn5UXzUoPS4JF6%2Fimage.png?alt=media&#x26;token=42dc718c-2698-4e4b-a00f-701770c01651" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FoZBbudgAdWBrcJW2fFVO%2Fimage.png?alt=media&#x26;token=b764989b-a315-4d51-be94-9ea908ec477c" alt=""><figcaption></figcaption></figure>

This way, you can proxy only the necessary services, while using the rest of the internet without network restrictions.
