Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

复用session设置指纹后比未设置指纹的请求 慢 4倍左右 #45

Open
gospider007 opened this issue Sep 22, 2023 · 0 comments

Comments

@gospider007
Copy link

package main

import (
	"log"
	"time"

	"github.com/wangluozhe/requests"
	"github.com/wangluozhe/requests/url"
)

var session = requests.NewSession()

func test(ja3 string) {
	req := url.NewRequest()
	req.Headers = url.NewHeaders()
	req.Ja3 = ja3
	t := time.Now()
	if r, err := session.Get("https://www.baidu.com", req); err != nil {
		log.Panic(err)
	} else {
		if req.Ja3 == "" {
			log.Print("普通请求:", len(r.Content), " : ", time.Since(t))
		} else {
			log.Print("ja3 请求:", len(r.Content), " : ", time.Since(t))
		}
	}
}
func main() {
	ja3 := "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,11-35-18-16-5-13-45-27-17513-51-10-65281-0-43-23,29-23-24,0"
	test("")
	test("")
	test("")
	test("")
	test(ja3)
	test(ja3)
	test(ja3)
	test(ja3)
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant