AnyEvent-Twitter-Stream icon indicating copy to clipboard operation
AnyEvent-Twitter-Stream copied to clipboard

Allow using proxy argument in http_request

Open loicbertron opened this issue 11 years ago • 0 comments

Hello,

I've setup a script to launch many instance of AnyEvent::Twitter::Stream with differents parameters such Twitter user, track query, ... . I would like to use a different proxy per instance.

So i tried to add this patch to Stream.pm, but it doesn't work.

47d44 < my $proxy = delete $args{proxy}; 159d155 < proxy => $proxy, # ['12.34.56.78','3128']

If i understand correctly, http_request method is part of AnyEvent::HTTP (http://search.cpan.org/~mlehmann/AnyEvent-HTTP-2.15/HTTP.pm) which allow to use a proxy param. For me it doesn't work.

But if i declare AnyEvent::HTTP::set_proxy "proxy-url" at the beginning of the class AnyEvent::Twitter::Stream, it works. If i declare it anywhere in the new method of the same class, it fails.

One other important point. If the proxy part was correctly handled by http_request, i should get at least an error, like this one : 595 - errors during connection etsbalishment, proxy handshake.

But i don't get anything, and i see no traffic on my HTTP Proxy.

Thank you

loicbertron avatar Dec 09 '13 23:12 loicbertron