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

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

Open
ErenKrt opened this issue Aug 14, 2024 · 1 comment

Comments

@ErenKrt
Copy link

ErenKrt commented Aug 14, 2024

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
Copy link
Author

ErenKrt commented Aug 14, 2024

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.

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

When branches are created from issues, their pull requests are automatically linked.

1 participant