# 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="/files/NdHNtohx3Mx1PMIF3xik" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/cCD2tYhQkvjciAwB7uE7" 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="/files/Sb4rcMelY5Zmcqfxg8fw" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/UU8XMm0eX02wbScK8zlt" alt=""><figcaption></figcaption></figure>

Select Advanced Function -> Add.

<figure><img src="/files/9W2c9GvLSFvp5UMV8TGk" alt=""><figcaption></figcaption></figure>

Enter any name in the “Remarks” field.

<figure><img src="/files/UiIwiKh4vHkSjijDh7op" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/Ioa7gznqrWwgtyA9GsWK" 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="/files/uOmNy0eBjifNyWFuxlXN" 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="/files/53gG1d4KKlyEtU2f2QDM" 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="/files/tjfj1yBYGTcVhF9pP3fV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ErVJxWIAt7R5wQlUGC1n" 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="/files/VPBTCN1hXhxX7QkgISUU" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/thiolek8bP1mEZm6Jyg7" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/I8hsTKqtvBGmzDb14hVl" alt=""><figcaption></figcaption></figure>

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spacecore.gitbook.io/wiki/en/vpn-and-privacy/proxy-specific-domains-v2rayn.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
