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

Problems with proxy and {:error, :closed} #474

Open
atanych opened this issue Feb 7, 2018 · 5 comments
Open

Problems with proxy and {:error, :closed} #474

atanych opened this issue Feb 7, 2018 · 5 comments
Labels

Comments

@atanych
Copy link

atanych commented Feb 7, 2018

Hi Guys,

I caught weird behavior when I worked behind proxy.

Server 1 (behind proxy):
OS: Redhat.
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

options = [proxy: "http://xxx", proxy_auth: {"login", "pwd"}, ssl: [versions: [:'tlsv1.2']]]
:hackney.get("https://google.com", [], [], options)

image

url = "https://media-direct.cdn.viber.com/download_photo?dlid=Gsag08bVZ_qFBt5G_ssCKUKFN9MJsAodr-kKgBVxln9MbHaKkeJe5WHjkqILcgzfeell1-pwccBnMH3aFJwtu4F0glyNO-53pUJ8vSWbUnNxW9qVy-xY1_HO7g7Dpl5bcUvbaA&fltp=jpg&imsz=0000"
:hackney.get(url, [], [], options)

image

When I fetch image behind proxy, I receive {:error, :closed}

Server 2 (without proxy):
OS Centos.
Erlang/OTP 20 [erts-9.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Make the same things and receive correct result.
image

I made the same things with HTTPoison. The similar response.

Could you help me to find solution or workaround for this issue?

Thanks!

@atanych
Copy link
Author

atanych commented Feb 7, 2018

I figured out issue.

Was two problems:

  • old elixir and erlang packages
  • proxy is not used when follow_redirect is true

@benoitc
Copy link
Owner

benoitc commented Feb 7, 2018

yeah i should make sure we use the proxy on follow redirect. I will have a look tomorrow as it’s late herr already. Thanks for the report anyway!

@atanych
Copy link
Author

atanych commented Feb 7, 2018

yeah, thanks. It is related issue: #273

@collegeimprovements
Copy link

How to enable proxy to follow redirects ?

@collegeimprovements
Copy link

collegeimprovements commented May 3, 2018

@atanych , @benoitc can you help? I'm facing the same issue.

@benoitc benoitc added the proxy label Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants