Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny-Dasilva committed Nov 28, 2023
1 parent 351ae1f commit 2650b08
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 66 deletions.
20 changes: 20 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# CycleTLS Changelog

## 1.0.23 - (11-27-2023)
### Release Highlights
Switch to UTLS
Add Insecure Skip Verify for proxy bypass
Add Force HTTP1
### Enhancements
- [Add forceHTTP1 param to configure http version](https://github.com/Danny-Dasilva/CycleTLS/issues/268)
- add InsecureSkipVerify configuration option enabling bypassing the SSL certificate verification when making HTTP requests addressed by @lif0 in [this PR](https://github.com/Danny-Dasilva/CycleTLS/pull/279)
- [Add finalUrl response to track redirects ](https://github.com/Danny-Dasilva/CycleTLS/issues/121) @lif0 in [this PR](https://github.com/Danny-Dasilva/CycleTLS/pull/283)
- [Add support for application/x-www-form-urlencoded](https://github.com/Danny-Dasilva/CycleTLS/issues/155)
- [Add support for multipart/form-data](https://github.com/Danny-Dasilva/CycleTLS/issues/89)
- [Add CycleTLS Queue Example and test](https://github.com/Danny-Dasilva/CycleTLS/issues/128)
- [Add CookieJar Support in Golang](https://github.com/Danny-Dasilva/CycleTLS/issues/260), [duplicate](https://github.com/Danny-Dasilva/CycleTLS/issues/146), [other duplicate](https://github.com/Danny-Dasilva/CycleTLS/issues/222)
- [tag submodule cycletls](https://github.com/Danny-Dasilva/CycleTLS/issues/232)
- [Export transport for http client](https://github.com/Danny-Dasilva/CycleTLS/issues/151), addressed by @deoxykev in [this PR](https://github.com/Danny-Dasilva/CycleTLS/pull/286)
- Add support for ja3 `24` FakeTokenBindingExtension
- Add support for ja3 `34` DelegatedCredentialsExtension
- Add support for ja3 `41` UtlsPreSharedKeyExtension
- Add support for ja3 `50` SignatureAlgorithmsCertExtension
- Add support for ja3 `57` QUICTransportParametersExtension

## 1.0.22 - (10-24-2023)
### Release Highlights
Expand Down
85 changes: 19 additions & 66 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,76 +1,29 @@
package main

import (
"log"

// cycletls "github.com/Danny-Dasilva/CycleTLS/cycletls"
"./cycletls"
"log"
"runtime"
"time"
// "net/http"
)

// Static variables
var (
ja3 = "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0"
userAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
)

// RequestConfig holds the configuration for each request.
type RequestConfig struct {
URL string
Method string
Options cycletls.Options
}

func main() {
client := cycletls.Init(true) // Initialize with worker pool

// Define the requests
requests := []RequestConfig{
{
URL: "http://httpbin.org/delay/4",
Method: "GET",
Options: cycletls.Options{
Ja3: ja3,
UserAgent: userAgent,
},
},
{
URL: "http://httpbin.org/post",
Method: "POST",
Options: cycletls.Options{
Body: `{"field":"POST-VAL"}`,
Ja3: ja3,
UserAgent: userAgent,
},
},
{
URL: "http://httpbin.org/cookies",
Method: "GET",
Options: cycletls.Options{
Ja3: ja3,
UserAgent: userAgent,
Cookies: []cycletls.Cookie{
{
Name: "example1",
Value: "aaaaaaa",
},
},
},
},
}

// Queue the requests
for _, req := range requests {
client.Queue(req.URL, req.Options, req.Method)
}

// Asynchronously read responses as soon as they are available
// They will return as soon as they are processed
// e.g. Delay 3 will be returned last
for i := 0; i < len(requests); i++ {
response := <-client.RespChan
log.Println("Response:", response)
runtime.GOMAXPROCS(runtime.NumCPU())

start := time.Now()
defer func() {
log.Println("Execution Time: ", time.Since(start))
}()
client := cycletls.Init()
response, err := client.Do("https://www.google.com", cycletls.Options{
Body: "",
Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513,29-23-24,0",
UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
}, "GET")
if err != nil {
log.Print("Request Failed: " + err.Error())
}
log.Println(response.Status,)

// Close the client
client.Close()
}

0 comments on commit 2650b08

Please sign in to comment.