# How it works

{% hint style="warning" %}
**Learn:** we strongly recommend you reading the following so you know how we make this work before continuing to the installation.
{% endhint %}

## :man\_running: TL:DR

***

[<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) uses a proxy-based solution to avoid [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3) ads on Twitch. Twitch ads can't be blocked, at all, but can be avoided/bypassed.

Also known as "server-sided" solutions, [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) fully relies on a proxy in an ad-free country for it to avoid any possible Twitch ad that is embedded into the stream (also known as [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3)).

We avoid [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3) ads, but VOD or banner ads are not handled by the [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) project, as some other amazing project already handles those.&#x20;

[<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) **must** be used alongside [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) to ensure the effectiveness of the extension and to block VOD and banner ads. We won't give any support to users using different ad blockers (including uBlock Origin Lite) or not using any at all.

Additionally, you can add the following [<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) filter that's maintained by us to remove some stuff that [<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) default filters (at the time of writing) don't: `https://ttvlolpro.com/filter.txt`

{% hint style="warning" %}
[<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) by default provides a set of proxies for Firefox and Chromium users. We do apply rate limits on them, and a fair use policy. More information about that here: [proxy-information](https://wiki.cdn-perfprod.com/must-read/proxy-information "mention")
{% endhint %}

{% content-ref url="proxy-information" %}
[proxy-information](https://wiki.cdn-perfprod.com/must-read/proxy-information)
{% endcontent-ref %}

## :thinking: How it works

***

[<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) uses a proxy-based solution based on HTTP(S)/SOCKS proxies to avoid [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3) ads on Twitch. Twitch ads can't be blocked, at all, but can be avoided/bypassed.

Also known as "server-sided" solutions, [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) fully relies on a proxy in an ad-free country for it to avoid any possible Twitch ad that is embedded into the stream (also known as [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3)).

We avoid [<mark style="color:purple;">SSAI</mark>](https://clearcode.cc/blog/client-side-server-side-ad-insertion/#toc-label-3) ads, but VOD or banner ads are not handled by the [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) project, as some other amazing project already handles those.&#x20;

[<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) **must** be used alongside [<mark style="color:purple;">TTV LOL PRO</mark>](https://github.com/younesaassila/ttv-lol-pro) to ensure the effectiveness of the extension and to block VOD and banner ads. We won't give any support to users using different ad blockers (including uBlock Origin Lite) or not using any at all.

Additionally, you can add the following [<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) filter that's maintained by us to remove some stuff that [<mark style="color:purple;">uBlock Origin</mark>](https://ublockorigin.com/) default filters (at the time of writing) don't: `https://ttvlolpro.com/filter.txt`

To avoid/bypass the ads we proxy different Twitch endpoints which are the following:

* `video-weaver.*.hls.ttvnw.net` (Required)
* `*.playlist.live-video.net` (Required)
* `*.playlist.ttvnw.net` (Required)
* `usher.ttvnw.net` (Required)
* `gql.twitch.tv` (Required)
* `passport.twitch.tv` (Optional)
* `www.twitch.tv` (Optional)

However, we do not proxy the stream itself, which results in minimum bandwidth usage on the proxy's end. By default, the option "Proxy ad requests" is enabled, which reduces significantly the bandwidth usage compared to "Proxy all requests".

We do filter which requests to be proxied and which not. In some cases, for example, some `gql.twitch.tv` requests may be left unproxied as it's not needed.


---

# 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://wiki.cdn-perfprod.com/must-read/how-it-works.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.
