FlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.
FlareSolverr starts a proxy server, and it waits for user requests in an idle state using few resources. When some request arrives, it uses Selenium with the undetected-chromedriver to create a web browser (Chrome). It opens the URL with user parameters and waits until the Cloudflare challenge is solved (or timeout). The HTML code and the cookies are sent back to the user, and those cookies can be used to bypass Cloudflare using other HTTP clients.
NOTE: Web browsers consume a lot of memory. If you are running FlareSolverr on a machine with few RAM, do not make many requests at once. With each request a new browser is launched.
It is also possible to use a permanent session. However, if you use sessions, you should make sure to close them as soon as you are done using them.
It is recommended to install using a Docker container because the project depends on an external browser that is already included within the image.
Docker images are available in:
Supported architectures are:
| Architecture | Tag |
|---|---|
| x86 | linux/386 |
| x86-64 | linux/amd64 |
| ARM32 | linux/arm/v7 |
| ARM64 | linux/arm64 |
We provide a docker-compose.yml configuration file. Clone this repository and execute
docker-compose up -d (Compose V1) or docker compose up -d (Compose V2) to start
the container.
If you prefer the docker cli execute the following command:
Bash
docker run -d \
--name=flaresolverr \
-p 8191:8191 \
-e LOG_LEVEL=info \
--restart unless-stopped \
ghcr.io/flaresolverr/flaresolverr:latest
Command Prompt or Powershell
docker run -d --name=flaresolverr -p 8191:8191 -e LOG_LEVEL=info --restart unless-stopped ghcr.io/flaresolverr/flaresolverr:latest
If your host OS is Debian, make sure libseccomp2 version is 2.5.x. You can check the version with sudo apt-cache policy libseccomp2
and update the package with sudo apt install libseccomp2=2.5.1-1~bpo10+1 or sudo apt install libseccomp2=2.5.1-1+deb11u1.
Remember to restart the Docker daemon and the container after the update.
Warning Precompiled binaries are only available for x64 architecture. For other architectures see Docker images.
This is the recommended way for Windows users.
Warning Installing from source code only works for x64 architecture. For other architectures see Docker images.
pip install -r requirements.txt command to install FlareSolverr dependencies.python src/flaresolverr.py command to start FlareSolverr.pkg install chromium python313 py311-pip xorg-vfbserver command to install the required dependencies.python3.11 -m pip install -r requirements.txt command to install FlareSolverr dependencies.python3.11 src/flaresolverr.py command to start FlareSolverr.We provide an example Systemd unit file flaresolverr.service as reference. You have to modify the file to suit your needs: paths, user and environment variables.
Example Bash request:
curl -L -X POST 'http://localhost:8191/v1' \
-H 'Content-Type: application/json' \
--data-raw '{
"cmd": "request.get",
"url": "http://www.google.com/",
"maxTimeout": 60000
}'
Example Python request:
import requests
url = "http://localhost:8191/v1"
headers = {"Content-Type": "application/json"}
data = {
"cmd": "request.get",
"url": "http://www.google.com/",
"maxTimeout": 60000
}
response = requests.post(url, headers=headers, json=data)
print(response.text)
Example PowerShell request:
$body = @{
cmd = "request.get"
url = "http://www.google.com/"
maxTimeout = 60000
} | ConvertTo-Json
irm -UseBasicParsing 'http://localhost:8191/v1' -Headers @{"Content-Type"="application/json"} -Method Post -Body $body
sessions.createThis will launch a new browser instance which will retain cookies until you destroy it with sessions.destroy.
This comes in handy, so you don't have to keep solving challenges over and over and you won't need to keep sending
cookies for the browser to use.
This also speeds up the requests since it won't have to launch a new browser instance for every request.
| Parameter | Notes |
|---|---|
| session | Optional. The session ID that you want to be assigned to the instance. If isn't set a random UUID will be assigned. |
| proxy | Optional, default disabled. Eg: "proxy": {"url": "http://127.0.0.1:8888"}. You must include the proxy schema in the URL: http://, socks4:// or socks5://. Authorization (username/password) is supported. Eg: "proxy": {"url": "http://127.0.0.1:8888", "username": "testuser", "password": "testpass"} |
sessions.listReturns a list of all the active sessions. More for debugging if you are curious to see how many sessions are running. You should always make sure to properly close each session when you are done using them as too many may slow your computer down.
Example response:
{
"sessions": ["session_id_1", "session_id_2", "session_id_3..."]
}
sessions.destroyThis will properly shutdown a browser instance and remove all files associated with it to free up resources for a new session. When you no longer need to use a session you should make sure to close it.
| Parameter | Notes |
|---|---|
| session | The session ID that you want to be destroyed. |
request.get| Parameter | Notes |
|---|---|
| url | Mandatory |
| session | Optional. Will send the request from and existing browser instance. If one is not sent it will create a temporary instance that will be destroyed immediately after the request is completed. |
| session_ttl_minutes | Optional. FlareSolverr will automatically rotate expired sessions based on the TTL provided in minutes. |
| maxTimeout | Optional, default value 60000. Max timeout to solve the challenge in milliseconds. |
| cookies | Optional. Will be used by the headless browser. Eg: "cookies": [{"name": "cookie1", "value": "value1"}, {"name": "cookie2", "value": "value2"}]. |
| returnOnlyCookies | Optional, default false. Only returns the cookies. Response data, headers and other parts of the response are removed. |
| returnScreenshot | Optional, default false. Captures a screenshot of the final rendered page after all challenges and waits are completed. The screenshot is returned as a Base64-encoded PNG string in the screenshot field of the response. |
| proxy | Optional, default disabled. Eg: "proxy": {"url": "http://127.0.0.1:8888"}. You must include the proxy schema in the URL: http://, socks4:// or socks5://. Authorization (username/password) is not supported. (When the session parameter is set, the proxy is ignored; a session specific proxy can be set in sessions.create.) |
| waitInSeconds | Optional, default none. Length to wait in seconds after solving the challenge, and before returning the results. Useful to allow it to load dynamic content. |
| disableMedia | Optional, default false. When true FlareSolverr will prevent media resources (images, CSS, and fonts) from being loaded to speed up navigation. |
| tabs_till_verify | Optional, default none. Number of times the Tab button is needed to be pressed to end up on the turnstile captcha, in order to verify it. After verifying the captcha, the result will be stored in the solution under turnstile_token. |
Warning If you want to use Cloudflare clearance cookie in your scripts, make sure you use the FlareSolverr User-Agent too. If they don't match you will see the challenge.
Example response from running the curl above:
```json { "solution": { "url": "https://www.google.com/?gws_rd=ssl", "status": 200, "headers": { "status": "200", "date": "Thu, 16 Jul 2020 04:15:49 GMT", "expires": "-1", "cache-control": "private, max-age=0", "content-type": "text/html; charset=UTF-8", "stric
$ claude mcp add FlareSolverr \
-- python -m otcore.mcp_server <graph>