Noooste / azuretls-client

An easy-to-use HTTP client 100% in Go to spoof TLS/JA3 and HTTP2 fingerprint
MIT License
172 stars 25 forks source link

When i send more than one request using single session, get "unexpected EOF" #124

Open ErenKrt opened 2 months ago

ErenKrt commented 2 months ago

If I send more than one request using a session, I get an "unexpected EOF" error. When I tried it on other sites, I didn't encounter it much, but "https://tls.peet.ws/api/all" does this all the time. I think sites like this may cause problems for this project in the future.

image

func main() {
    session := azuretls.NewSession()
    session.Browser = azuretls.Chrome

    _, err := session.Do(&azuretls.Request{
        Method:           "GET",
        Url:              "https://tls.peet.ws/api/all",
        DisableRedirects: true,
    })

    if err != nil {
        panic(err)
    }

    fmt.Println("GET FIRST RESPONSE")

    _, err1 := session.Do(&azuretls.Request{
        Method:           "GET",
        Url:              "https://tls.peet.ws/api/all",
        DisableRedirects: true,
    })

    if err1 != nil {
        panic(err1)
    }

    fmt.Println("GET SECOND RESPONSE")

    defer session.Close()

}
ErenKrt commented 2 months ago

My code worked when I added "session.ClearProxy()" between my two requests. I think the problem is with the connections that are open and in the pool.