codemanki / cloudscraper

--DEPRECATED -- 🛑 🛑 Node.js library to bypass cloudflare's anti-ddos page
MIT License
602 stars 139 forks source link

Browser support #33

Closed williamoliveira closed 7 years ago

williamoliveira commented 7 years ago

Could this be tweaked to work in the browser also?

dfanara commented 7 years ago

I suppose you could write a nodejs app to act as an HTTP proxy, where the proxy itself uses cloudscraper to bypass cloudflare and then serves the content back to the browser.

williamoliveira commented 7 years ago

Yeah, I could, I am currently doing the scrapping on backend with cheerio but I am trying to make my app serverless

dfanara commented 7 years ago

Are you looking to use it in a specific browser? If you don't have anything specific in mind, you could use http://electron.atom.io/ with Chromium and use cloudscraper to load all of the content to display clientside. You may be able to hook into the electron API to force all of the traffic directly through cloudscraper.

Also, you could write the NodeJS implementation and run a local instance of the HTTP proxy, however that'd require installing the NodeJS binaries which might not be desirable.

williamoliveira commented 7 years ago

That wouldnt work for me, its a normal web application. I will fork this project and see if I can modify to use axios or something instead of request

GoChartingAdmin commented 6 years ago

@williamoliveira Did you make any progress on browser side usage of cloudscraper?

williamoliveira commented 6 years ago

Nope, I dropped the project I was working on

ghost commented 5 years ago

These tests seem to indicate that request has had browser support for years. Use a good bundler such as webpack and everything should work.

Edit: The only dependencies that cloudscraper has is request and the native vm module. Both webpack and browserify support the way cloudscraper is using the vm module: https://github.com/browserify/vm-browserify.

However, I do think that pulling the parser related bits out into a separate js file would be great.

See https://github.com/codemanki/cloudscraper/issues/80