first commit
This commit is contained in:
33
cycletls.go
Normal file
33
cycletls.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package flaresolverr
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Danny-Dasilva/CycleTLS/cycletls"
|
||||
)
|
||||
|
||||
type cycletlsClient struct {
|
||||
client cycletls.CycleTLS
|
||||
ja3 string
|
||||
userAgent string
|
||||
}
|
||||
|
||||
func NewCycletlsClient(ja3, userAgent string) *cycletlsClient {
|
||||
return &cycletlsClient{
|
||||
client: cycletls.Init(),
|
||||
ja3: ja3,
|
||||
userAgent: userAgent,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cycletlsClient) Get(URL string, opts *cycletls.Options) (cycletls.Response, error) {
|
||||
opts.Ja3 = c.ja3
|
||||
opts.UserAgent = c.userAgent
|
||||
return c.client.Do(URL, *opts, http.MethodGet)
|
||||
}
|
||||
|
||||
func (c *cycletlsClient) Post(URL string, opts *cycletls.Options) (cycletls.Response, error) {
|
||||
opts.Ja3 = c.ja3
|
||||
opts.UserAgent = c.userAgent
|
||||
return c.client.Do(URL, *opts, http.MethodPost)
|
||||
}
|
||||
Reference in New Issue
Block a user