Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/cfhttr
:construction_worker: Workaround Cloudflare Anti-DDoS Protection
https://github.com/hrbrmstr/cfhttr
cloudflare ddos httr r rstats rvest
Last synced: 2 months ago
JSON representation
:construction_worker: Workaround Cloudflare Anti-DDoS Protection
- Host: GitHub
- URL: https://github.com/hrbrmstr/cfhttr
- Owner: hrbrmstr
- Created: 2017-12-10T13:47:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T13:47:47.000Z (about 7 years ago)
- Last Synced: 2024-08-04T03:03:54.574Z (4 months ago)
- Topics: cloudflare, ddos, httr, r, rstats, rvest
- Language: R
- Homepage:
- Size: 8.79 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: rmarkdown::github_document
---# cfhttr
Workaround Cloudflare Anti-DDoS Protection
## Description
Some sites use Cloudflare's anti-DDoS protection to, well, avoid being DDoS'd.
However, many of these sites also host files that they intended for automated download workflows and often forget to exclude those from the heavy-handed anti-DDoS, javascript + human-required settings.
Cloudflare employs a few different anti-DDoS protection schemes. One involves a 503 HTTP response followed by the submission of a "challenge" that was solved via a bit of javascript on the page. _That's what this pacakge handles._ If you encounter other Cloudflare anti-DDoS protection schemes (especially the captcha one), then this won't work.
## NOTE
If this ceases to work it likely means that Cloudflare changed the challenge code. Please [file an issue](https://github.com/hrbrmstr/cfhttr/issues) so I can redo the workaround.
## What's Inside The Tin
The following functions are implemented:
- `cf_GET`: Cloudflare bypass version of `httr::GET()`
## Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/cfhttr")
``````{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
library(cfhttr)# current verison
packageVersion("cfhttr")
``````{r}
res <- cf_GET("https://www.bitmarket.pl/graphs/BTCPLN/90m.json")
str(httr::content(res, as="parsed"))
```