Commit 21bcf2d0 authored by wangmingming's avatar wangmingming

11

parent a7024b19
......@@ -18,6 +18,7 @@ type Client struct {
Item ForwardItem
Response *http.Response
uri *url.URL
TlsVersion string
}
func (c *Client) Start() error {
......@@ -127,10 +128,10 @@ func RandRandom(a int64) int64 {
}
func NewClient(forWard ForwardItem) (Client, error) {
jar := tls_client.NewCookieJar()
tlsVersion := chromes[RandRandom(int64(len(chromes)))]
options := []tls_client.HttpClientOption{
tls_client.WithTimeoutSeconds(forWard.Timeout),
tls_client.WithClientProfile(chromes[RandRandom(int64(len(chromes)))]),
tls_client.WithClientProfile(tlsVersion),
tls_client.WithProxyUrl(forWard.Proxy),
//tls_client.WithForceHttp1(),
tls_client.WithCookieJar(jar),
......@@ -143,5 +144,5 @@ func NewClient(forWard ForwardItem) (Client, error) {
if err != nil {
return Client{}, err
}
return Client{Client: client, Item: forWard, Jar: jar}, nil
return Client{Client: client, Item: forWard, Jar: jar, TlsVersion: tlsVersion.GetClientHelloStr()}, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment