wangluozhe / requests

用于快速请求HTTP或HTTPS,并支持修改ja3、ja4指纹
GNU General Public License v3.0
417 stars 93 forks source link

未知的EOF 错误 #32

Closed gospider007 closed 1 year ago

gospider007 commented 1 year ago
版本v1.1.14
package main

import (
    "log"

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

func getIp(session *requests.Session, proxy string) {
    req := url.NewRequest()
    req.Proxies = proxy
    r, err := session.Get("https://tools.scrapfly.io/api/fp/anything", req)
    if err != nil {
        log.Panic(err)
    } else {
        log.Print(r.Text)
    }
}
func main() {
    session := requests.NewSession()
    getIp(session, "")
}
panic: Get "https://tools.scrapfly.io/api/fp/anything": EOF
wangluozhe commented 1 year ago

因为这个网站拒绝非http2的请求,你给他加个req.JA3 = "..."即可正常访问。