CiEL7 commited on
Commit
792b849
·
verified ·
1 Parent(s): dd7f5fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -255
README.md CHANGED
@@ -1,255 +1,8 @@
1
- # FlareSolverr v2
2
-
3
- [![Latest release](https://img.shields.io/github/v/release/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/releases)
4
- [![Docker Pulls](https://img.shields.io/docker/pulls/flaresolverr/flaresolverr)](https://hub.docker.com/r/flaresolverr/flaresolverr)
5
- [![Docker Stars](https://img.shields.io/docker/stars/flaresolverr/flaresolverr)](https://hub.docker.com/r/flaresolverr/flaresolverr)
6
- [![GitHub issues](https://img.shields.io/github/issues/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/issues)
7
- [![GitHub pull requests](https://img.shields.io/github/issues-pr/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr/pulls)
8
- [![GitHub Repo stars](https://img.shields.io/github/stars/FlareSolverr/FlareSolverr)](https://github.com/FlareSolverr/FlareSolverr)
9
-
10
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/ngosang)
11
-
12
- ⚠ This repository contains the code of FlareSolverr v2. For the latest release check [https://github.com/FlareSolverr/FlareSolverr](https://github.com/FlareSolverr/FlareSolverr). This repository is not maintained.
13
-
14
- FlareSolverr is a proxy server to bypass Cloudflare and DDoS-GUARD protection.
15
-
16
- ## How it works
17
-
18
- FlareSolverr starts a proxy server, and it waits for user requests in an idle state using few resources.
19
- When some request arrives, it uses [puppeteer](https://github.com/puppeteer/puppeteer) with the
20
- [stealth plugin](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth)
21
- to create a headless browser (Firefox). It opens the URL with user parameters and waits until the Cloudflare challenge
22
- is solved (or timeout). The HTML code and the cookies are sent back to the user, and those cookies can be used to
23
- bypass Cloudflare using other HTTP clients.
24
-
25
- **NOTE**: Web browsers consume a lot of memory. If you are running FlareSolverr on a machine with few RAM, do not make
26
- many requests at once. With each request a new browser is launched.
27
-
28
- It is also possible to use a permanent session. However, if you use sessions, you should make sure to close them as
29
- soon as you are done using them.
30
-
31
- ## Installation
32
-
33
- ### Docker
34
-
35
- It is recommended to install using a Docker container because the project depends on an external browser that is
36
- already included within the image.
37
-
38
- Docker images are available in:
39
- * GitHub Registry => https://github.com/orgs/FlareSolverr/packages/container/package/flaresolverr
40
- * DockerHub => https://hub.docker.com/r/flaresolverr/flaresolverr
41
-
42
- Supported architectures are:
43
- | Architecture | Tag |
44
- | :----: | --- |
45
- | x86-64 | linux/amd64 |
46
- | ARM64 | linux/arm64 |
47
- | ARM32 | linux/arm/v7 |
48
-
49
- We provide a `docker-compose.yml` configuration file. Clone this repository and execute `docker-compose up -d` to start
50
- the container.
51
-
52
- If you prefer the `docker cli` execute the following command.
53
- ```bash
54
- docker run -d \
55
- --name=flaresolverr \
56
- -p 8191:8191 \
57
- -e LOG_LEVEL=info \
58
- --restart unless-stopped \
59
- ghcr.io/flaresolverr/flaresolverr:latest
60
- ```
61
-
62
- 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`
63
- 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`.
64
- Remember to restart the Docker daemon and the container after the update.
65
-
66
- ### Precompiled binaries
67
-
68
- This is the recommended way for Windows users.
69
- * Download the [FlareSolverr zip](https://github.com/FlareSolverr/FlareSolverr/releases) from the release's assets. It is available for Windows and Linux.
70
- * Extract the zip file. FlareSolverr executable and firefox folder must be in the same directory.
71
- * Execute FlareSolverr binary. In the environment variables section you can find how to change the configuration.
72
-
73
- ### From source code
74
-
75
- This is the recommended way for macOS users and for developers.
76
- * Install [NodeJS](https://nodejs.org/) 16.
77
- * Clone this repository and open a shell in that path.
78
- * Run `export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true` (Linux/macOS) or `set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true` (Windows).
79
- * Run `npm install` command to install FlareSolverr dependencies.
80
- * Run `npm start` command to compile TypeScript code and start FlareSolverr.
81
-
82
- If you get errors related to firefox not installed try running `node install.js` to install Firefox.
83
-
84
- ### Systemd service
85
-
86
- 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.
87
-
88
- ## Usage
89
-
90
- Example request:
91
- ```bash
92
- curl -L -X POST 'http://localhost:8191/v1' \
93
- -H 'Content-Type: application/json' \
94
- --data-raw '{
95
- "cmd": "request.get",
96
- "url":"http://www.google.com/",
97
- "maxTimeout": 60000
98
- }'
99
- ```
100
-
101
- ### Commands
102
-
103
- #### + `sessions.create`
104
-
105
- This will launch a new browser instance which will retain cookies until you destroy it with `sessions.destroy`.
106
- This comes in handy, so you don't have to keep solving challenges over and over and you won't need to keep sending
107
- cookies for the browser to use.
108
-
109
- This also speeds up the requests since it won't have to launch a new browser instance for every request.
110
-
111
- Parameter | Notes
112
- |--|--|
113
- session | Optional. The session ID that you want to be assigned to the instance. If isn't set a random UUID will be assigned.
114
- 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.
115
-
116
- #### + `sessions.list`
117
-
118
- Returns a list of all the active sessions. More for debugging if you are curious to see how many sessions are running.
119
- You should always make sure to properly close each session when you are done using them as too many may slow your
120
- computer down.
121
-
122
- Example response:
123
-
124
- ```json
125
- {
126
- "sessions": [
127
- "session_id_1",
128
- "session_id_2",
129
- "session_id_3..."
130
- ]
131
- }
132
- ```
133
-
134
- #### + `sessions.destroy`
135
-
136
- This will properly shutdown a browser instance and remove all files associated with it to free up resources for a new
137
- session. When you no longer need to use a session you should make sure to close it.
138
-
139
- Parameter | Notes
140
- |--|--|
141
- session | The session ID that you want to be destroyed.
142
-
143
- #### + `request.get`
144
-
145
- Parameter | Notes
146
- |--|--|
147
- url | Mandatory
148
- 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.
149
- maxTimeout | Optional, default value 60000. Max timeout to solve the challenge in milliseconds.
150
- cookies | Optional. Will be used by the headless browser. Follow [this](https://github.com/puppeteer/puppeteer/blob/v3.3.0/docs/api.md#pagesetcookiecookies) format.
151
- returnOnlyCookies | Optional, default false. Only returns the cookies. Response data, headers and other parts of the response are removed.
152
- 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`.)
153
-
154
- :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.
155
-
156
- Example response from running the `curl` above:
157
-
158
- ```json
159
- {
160
- "solution": {
161
- "url": "https://www.google.com/?gws_rd=ssl",
162
- "status": 200,
163
- "headers": {
164
- "status": "200",
165
- "date": "Thu, 16 Jul 2020 04:15:49 GMT",
166
- "expires": "-1",
167
- "cache-control": "private, max-age=0",
168
- "content-type": "text/html; charset=UTF-8",
169
- "strict-transport-security": "max-age=31536000",
170
- "p3p": "CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"",
171
- "content-encoding": "br",
172
- "server": "gws",
173
- "content-length": "61587",
174
- "x-xss-protection": "0",
175
- "x-frame-options": "SAMEORIGIN",
176
- "set-cookie": "1P_JAR=2020-07-16-04; expires=Sat..."
177
- },
178
- "response":"<!DOCTYPE html>...",
179
- "cookies": [
180
- {
181
- "name": "NID",
182
- "value": "204=QE3Ocq15XalczqjuDy52HeseG3zAZuJzID3R57...",
183
- "domain": ".google.com",
184
- "path": "/",
185
- "expires": 1610684149.307722,
186
- "size": 178,
187
- "httpOnly": true,
188
- "secure": true,
189
- "session": false,
190
- "sameSite": "None"
191
- },
192
- {
193
- "name": "1P_JAR",
194
- "value": "2020-07-16-04",
195
- "domain": ".google.com",
196
- "path": "/",
197
- "expires": 1597464949.307626,
198
- "size": 19,
199
- "httpOnly": false,
200
- "secure": true,
201
- "session": false,
202
- "sameSite": "None"
203
- }
204
- ],
205
- "userAgent": "Windows NT 10.0; Win64; x64) AppleWebKit/5..."
206
- },
207
- "status": "ok",
208
- "message": "",
209
- "startTimestamp": 1594872947467,
210
- "endTimestamp": 1594872949617,
211
- "version": "1.0.0"
212
- }
213
- ```
214
-
215
- ### + `request.post`
216
-
217
- This is the same as `request.get` but it takes one more param:
218
-
219
- Parameter | Notes
220
- |--|--|
221
- postData | Must be a string with `application/x-www-form-urlencoded`. Eg: `a=b&c=d`
222
-
223
- ## Environment variables
224
-
225
- Name | Default | Notes
226
- |--|--|--|
227
- LOG_LEVEL | info | Verbosity of the logging. Use `LOG_LEVEL=debug` for more information.
228
- LOG_HTML | false | Only for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level.
229
- CAPTCHA_SOLVER | none | Captcha solving method. It is used when a captcha is encountered. See the Captcha Solvers section.
230
- TZ | UTC | Timezone used in the logs and the web browser. Example: `TZ=Europe/London`.
231
- HEADLESS | true | Only for debugging. To run the web browser in headless mode or visible.
232
- BROWSER_TIMEOUT | 40000 | If you are experiencing errors/timeouts because your system is slow, you can try to increase this value. Remember to increase the `maxTimeout` parameter too.
233
- TEST_URL | https://www.google.com | FlareSolverr makes a request on start to make sure the web browser is working. You can change that URL if it is blocked in your country.
234
- PORT | 8191 | Listening port. You don't need to change this if you are running on Docker.
235
- HOST | 0.0.0.0 | Listening interface. You don't need to change this if you are running on Docker.
236
-
237
- Environment variables are set differently depending on the operating system. Some examples:
238
- * Docker: Take a look at the Docker section in this document. Environment variables can be set in the `docker-compose.yml` file or in the Docker CLI command.
239
- * Linux: Run `export LOG_LEVEL=debug` and then start FlareSolverr in the same shell.
240
- * Windows: Open `cmd.exe`, run `set LOG_LEVEL=debug` and then start FlareSolverr in the same shell.
241
-
242
- ## Captcha Solvers
243
-
244
- :warning: At this time none of the captcha solvers work. You can check the status in the open issues. Any help is welcome.
245
-
246
- Sometimes CloudFlare not only gives mathematical computations and browser tests, sometimes they also require the user to
247
- solve a captcha.
248
- If this is the case, FlareSolverr will return the error `Captcha detected but no automatic solver is configured.`
249
-
250
- FlareSolverr can be customized to solve the captchas automatically by setting the environment variable `CAPTCHA_SOLVER`
251
- to the file name of one of the adapters inside the [/captcha](src/captcha) directory.
252
-
253
- ## Related projects
254
-
255
- * C# implementation => https://github.com/FlareSolverr/FlareSolverrSharp
 
1
+ ---
2
+ license: apache-2.0
3
+ title: Awuuu
4
+ sdk: gradio
5
+ emoji: 🐢
6
+ colorFrom: red
7
+ colorTo: red
8
+ ---