flaresolverr/cycletls.go

34 lines
744 B
Go
Raw Normal View History

2025-02-26 15:51:34 +11:00
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)
}