Files
go-flaresolverr/cycletls.go

34 lines
756 B
Go

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(reqURL string, opts *cycletls.Options) (cycletls.Response, error) {
opts.Ja3 = c.ja3
opts.UserAgent = c.userAgent
return c.client.Do(reqURL, *opts, http.MethodGet)
}
func (c *cycletlsClient) Post(reqURL string, opts *cycletls.Options) (cycletls.Response, error) {
opts.Ja3 = c.ja3
opts.UserAgent = c.userAgent
return c.client.Do(reqURL, *opts, http.MethodPost)
}