Git Product home page Git Product logo

cloudscraper_go's Introduction

CloudScraper Go

Simple go module to bypass CloudFlare securities

For now only passive checks based on TLS footprint (JA3) and user agents are handled
Inspired of python project https://github.com/venomous/cloudscraper

Rely on CycleTls to customize JA3

JA3 list: https://raw.githubusercontent.com/trisulnsm/trisul-scripts/master/lua/frontend_scripts/reassembly/ja3/prints/ja3fingerprint.json

Find my JA3: https://kawayiyi.com/tls

Example of usage

Simple Post

package main

import (
	"github.com/RomainMichau/cloudscraper_go/cloudscraper"
)

func main() {

	client, _ := cloudscraper.Init(false, false)
	res, _ := client.Post("https://www.facebook.com/anything/", make(map[string]string), "")
	res2, _ := client.Get("https://www.facebook.com/anything/", make(map[string]string), "")
	print(res.Body)
	print(res2.Body)
}

Customize request

package main

import (
	"github.com/Danny-Dasilva/CycleTLS/cycletls"
	"github.com/RomainMichau/cloudscraper_go/cloudscraper"
)

func main() {

	client, _ := cloudscraper.Init(false, false)
	options := cycletls.Options{
		Headers:         map[string]string{"my_custom_header": "header_value"},
		Body:            "",
		Proxy:           "proxy.company.com",
		Timeout:         10,
		DisableRedirect: true,
	}
	res, _ := client.Do("https://www.facebook.com/anything", options, "PUT")
	print(res.Body)
}

Async Request

package main

import (
	"github.com/Danny-Dasilva/CycleTLS/cycletls"
	"github.com/RomainMichau/cloudscraper_go/cloudscraper"
)

func main() {

	client, _ := cloudscraper.Init(false, true)
	options := cycletls.Options{
		Headers:         map[string]string{"my_custom_header": "header_value"},
		Body:            "",
		Timeout:         10,
		DisableRedirect: true,
	}
	client.Queue("https://www.facebook.com/anything", options, "PUT")
	respChannel := client.RespChan()
	res := <-respChannel
	print(res.Body)
}

Todo

  • Bypass cloudflare active counter-measure (JS challenge) as done on python cloudscraper

cloudscraper_go's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.