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

https proxy not working with Cro::HTTP::Client #116

Open
CIAvash opened this issue Nov 7, 2020 · 5 comments
Open

https proxy not working with Cro::HTTP::Client #116

CIAvash opened this issue Nov 7, 2020 · 5 comments

Comments

@CIAvash
Copy link

CIAvash commented Nov 7, 2020

I tested the new proxy support, and https proxy doesn't seem to work.
Here is the code I tried:

use Cro::HTTP::Client;
my $resp = await Cro::HTTP::Client.get('https://httpbin.org/ip');
say await $resp.body;

Then I set HTTP_PROXY and HTTPS_PROXY to http://127.0.0.1:8118. The script hangs for a while and then prints Buf:0x<>.

When I try http://httpbin.org/ip, it works correctly.

@vendethiel
Copy link
Member

Hi,

Can you please provide some more information on how to reproduce your bug?
I've tried with a few public proxies and was unable to do so.

@CIAvash
Copy link
Author

CIAvash commented Dec 12, 2020

I'm using Tor, and Privoxy for http(s) proxy.

I should say that my proxy works with curl and mojo command line tool.

Please tell me if you need more information.

@jnthn
Copy link
Member

jnthn commented Dec 12, 2020

Any idea if your proxy supports HTTP 2? Can you try using Cro::HTTP::Client in HTTP/1.1 only mode?

@jnthn
Copy link
Member

jnthn commented Dec 12, 2020

Also, if you could set CRO_TRACE=1 in the environment and run it and put the output here, it may be useful.

@CIAvash
Copy link
Author

CIAvash commented Dec 12, 2020

Any idea if your proxy supports HTTP 2? Can you try using Cro::HTTP::Client in HTTP/1.1 only mode?

I don't know, but enabling HTTP/1.1 had no effect.

Also, if you could set CRO_TRACE=1 in the environment and run it and put the output here, it may be useful.

[TRACE(anon 1)] Cro::HTTP::RequestSerializer EMIT TCP Message
  47 45 54 20 68 74 74 70 73 3a 2f 2f 68 74 74 70  GET https://http
  62 69 6e 2e 6f 72 67 2f 69 70 20 48 54 54 50 2f  bin.org/ip HTTP/
  31 2e 31 0d 0a 48 6f 73 74 3a 20 68 74 74 70 62  1.1..Host: httpb
  69 6e 2e 6f 72 67 0d 0a 55 73 65 72 2d 61 67 65  in.org..User-age
  6e 74 3a 20 43 72 6f 0d 0a 43 6f 6e 6e 65 63 74  nt: Cro..Connect
  69 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 0d 0a        ion: close....

[TRACE(anon 1)] Cro::TCP::Connector EMIT TCP Message
  48 54 54 50 2f 31 2e 31 20 32 30 30 20 43 6f 6e  HTTP/1.1 200 Con
  6e 65 63 74 69 6f 6e 20 65 73 74 61 62 6c 69 73  nection establis
  68 65 64 0d 0a 0d 0a                             hed....

[TRACE(anon 1)] Cro::HTTP::ResponseParser EMIT HTTP Response
  HTTP/1.1 200 OK
[TRACE(anon 1)] Cro::HTTP::RequestSerializer DONE
[TRACE(anon 1)] Cro::TCP::Connector DONE
[TRACE(anon 1)] Cro::HTTP::ResponseParser DONE
Buf:0x<>

It hanged for a while after [TRACE(anon 1)] Cro::HTTP::RequestSerializer DONE.

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

3 participants