# ClashX

**1) Downloading the required version of ClashX**\
&#x20;You need to go to the official GitHub of the ClashX project and download the required version of the archive for your OS. The example shows a setup on Windows OS ([Clash.for.Windows-0.20.39-win.7z](https://github.com/lantongxue/clash_for_windows_pkg/releases/download/0.20.39/Clash.for.Windows-0.20.39-win.7z)).<br>

Link to Github: <https://github.com/lantongxue/clash_for_windows_pkg/releases>

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FXaKZdg5WSopfpHg1NbS1%2Fimage.png?alt=media&#x26;token=91f4f06d-545c-4204-9124-bdaa1da8b9cd" alt=""><figcaption></figcaption></figure>

**2) Unpacking and launching ClashX**

Next you need to extract the archive and run as *<mark style="color:red;">**administrator**</mark>* "Clash for Windows.exe" as shown in the screenshots below.

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FppvvaGtuiqLjnzDAj9nA%2Fimage.png?alt=media&#x26;token=bd535372-eee6-4a58-9290-4b47c3975f94" alt="" width="563"><figcaption><p>Extracting the archive to the desktop</p></figcaption></figure>

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FDUapBEH0KcLzVneWcpNK%2Fimage.png?alt=media&#x26;token=57930702-7899-46c8-ab02-f9d728dd09c0" alt="" width="375"><figcaption><p>Run as administrator</p></figcaption></figure>

**3) Go to configuration settings**

After launching the program you need to go to "<mark style="background-color:green;">Profiles</mark>" and open the editor for config.yaml

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FpzBznXar9ikZB1xEx3aw%2Fimage.png?alt=media&#x26;token=e9ac5f7b-abe5-4d27-9e12-f5bb8522a2f4" alt="" width="375"><figcaption></figcaption></figure>

**4) Configuration setup**

Make the configuration of the file as in the example below, specifying your proxies from the order:

```yaml
proxies:
  - name: "ProxyShard-Germany-testname"
    type: socks5
    server: 123.123.123.123
    port: 1234
    username: proxy_login
    password: password_login
    udp: true

proxy-groups:
  - name: "Auto"
    type: select
    proxies:
      - ProxyShard-Germany-testname

rules:
  - PROCESS-NAME,chrome.exe,Auto
  - MATCH,DIRECT
```

In the end you should get something like this:

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FlPm1hdg2uamrFFgB0GSr%2Fimage.png?alt=media&#x26;token=6f1eb6e9-57fe-48cc-8346-3b543633ed01" alt="" width="563"><figcaption><p>Configuration example</p></figcaption></figure>

You should also clarify which fields are responsible for what ([link](https://docs.proxyshard.com/eng/our-products/about-the-udp-protocol/example-of-configuring-and-working-with-udp/broken-reference) about the proxy fields from the order).

<pre><code>proxies:
  - name: "ProxyShard-Germany-testname"       | Here you set the proxy name
    type: socks5                              | Type of protocol 
    server: 123.123.123.123                   | Proxy address or domain 
    port: 1234                                | Proxy port
    username: proxy_login                     | Proxy login                    
    password: password_login                  | Proxy password 
    udp: true                                  
proxy-groups:
  - name: "Auto"
    type: select
    proxies:
      - ProxyShard-Germany-testname              

rules:
  - PROCESS-NAME,<a data-footnote-ref href="#user-content-fn-1">chrome.exe</a>,Auto   | Selection of a specific application to be proxied 
  - MATCH,DIRECT      | In our example the Chrome browser is used,
                      | but it can be any of your applications, for example discord.exe  
                      | - MATCH,DIRECT : Indicates that all traffic that is not Chrome
                      | will be redirected not to the proxy, but to your primary interface               
</code></pre>

**5) Configuration check**

After configuring, you need to open "Proxies" and select the "Global" option and perform a check of your configuration set in step 4.&#x20;

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2F3n4VBpbW3iHZedDAvyeK%2Fimage.png?alt=media&#x26;token=b7214a69-260e-4e5c-9670-dea2490f80b3" alt="" width="563"><figcaption></figcaption></figure>

If the check failed and you have "Failed", compare with the configuration file and make sure that all proxy data is entered correctly. If the settings are correct, you will get a successful check output as in the screenshot below.

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2F1sDWiuw9OXhz4kIY875F%2Fimage.png?alt=media&#x26;token=92b57e38-e5a8-4aca-9fea-6b7fbf4aff66" alt=""><figcaption></figcaption></figure>

**6) Installing and enabling the TAP interface**

&#x20;Next go to "General" and install the TAP interface on your computer, it will create a new interface to which the proxy will be bound.&#x20;

After installing the TUN interface you need to enable TUN Mode, as in the screenshot in the 4th frame

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FHdzr5wIX6Q2Zu0OmYuzQ%2Fimage.png?alt=media&#x26;token=320103a4-0861-49ea-881b-320eaf444920" alt="" width="563"><figcaption></figcaption></figure>

**7) Functionality check**

If everything started successfully, you can open the application you configured the config for (step 4) and enjoy your programs working with UDP traffic proxying enabled!<br>

In our example the proxying was done for Chrome and we can check on [checkers](https://docs.proxyshard.com/eng/our-products/about-the-udp-protocol/where-you-can-check-webrtc-leaks).

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FwmeyIwKoBbgHwnnBfUAY%2Fimage.png?alt=media&#x26;token=f68a68c1-3489-4b7a-bcd7-d192f6801f45" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2FeBaUqonn0Py8gzHxT08c%2Fimage.png?alt=media&#x26;token=42555bbe-2870-4253-8d2e-0d6e2d1c9ef6" alt="" width="563"><figcaption></figcaption></figure>

If the check or proxying [does not work](https://docs.proxyshard.com/eng/our-products/about-the-udp-protocol/example-of-configuring-and-working-with-udp), make sure that you launched ClashX as administrator and that steps 4 through 6 were completed correctly.&#x20;

**8) Adding multiple proxies and switching between them**\
To be able to quickly switch between proxies, you need to add new proxies to the configuration from step 4. The names "ProxyShard-DE-testname1" are arbitrary and can be chosen at your discretion.&#x20;

The main point after adding is to specify the proxies also for the "proxy-group", as demonstrated below:

```yaml
proxies:
  - name: "ProxyShard-DE-testname1"
    type: socks5
    server: 123.123.123.123
    port: 42651
    username: LOgin
    password: pasSSWORD
    udp: true
    
  - name: "ProxyShard-NL-testname2"
    type: socks5
    server: 123.123.123.123
    port: 42651
    username: LOgin
    password: pasSSWORD
    udp: true

  - name: "ProxyShard-RO-testname3"
    type: socks5
    server: 123.123.123.123
    port: 42651
    username: LOgin
    password: pasSSWORD
    udp: true

proxy-groups:
  - name: "Auto"
    type: select
    proxies:
      - ProxyShard-DE-testname1
      - ProxyShard-NL-testname2
      - ProxyShard-RO-testname3

rules:
  - PROCESS-NAME,chrome.exe,Auto
  - MATCH,DIRECT
```

If you specified everything correctly, you will see additional connection points in "Proxies" and depending on the chosen profile settings (just click any), the connection will be made.

<figure><img src="https://3044836706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3l0uO4OV4DD1gK4uKGC6%2Fuploads%2Fp8UmvkSn2RDdgmQco7fk%2Fimage.png?alt=media&#x26;token=d141cf9a-a14b-42f0-b452-0a5166c0e404" alt=""><figcaption></figcaption></figure>

[^1]: application to be proxied
