Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Proxy link rotation

by kazak (Beadle)
on Jan 27, 2012 at 16:08 UTC ( [id://950403]=note: print w/replies, xml ) Need Help??


in reply to Re: Proxy link rotation
in thread [Resolved]Proxy link rotation

Sorry JavaFan my bad again, so:

1. Not working:

When I try to use a random array element for rotation, proxy is going directly without parent proxies at all, but when I'm copying\pasting any element of "@valid_routes" array into my code and use it directly, everything is going ok, proxy is used for serving requests. In other words:

If I'm using:

$cur_proxy$j - it's not working

http://111.111.111.111:12345/ - it's working. This IP was pasted from simple .txt file. As far as I can see this should prove that request is being prepared, authorization on parent proxy is going Ok, and approach used for rotation of UserAgent string may be right. Also I checked @valid_routes, it's filled before each request.

So now I'm just running out of ideas, what it might be.

Replies are listed 'Best First'.
Re^3: Proxy link rotation
by JavaFan (Canon) on Jan 27, 2012 at 23:16 UTC
    I don't quite know what you're saying -- I cannot relate everything to the code you're posted. For instance, now you're talking about $cur_proxy[$j], as if @cur_proxy is an array, but in your original code, $cur_proxy is a string.

    Let me ask it again, can you provide us with a small, standalone piece of code that shows the errorneous behaviour?

       $ua->proxy(['http'], $cur_proxy);

      It's here, $cur_proxy should be a string looking like this: http://111.111.111.111:12345/, randomly chosen from array . If I use $cur_proxy, this string is ignored, and traffic goes directly without any proxification. But if I comment out:

      my $cur_proxy = $valid_routes[$j]; $ua->proxy(['http'], $cur_proxy);

      and rewrite it like this:

       $ua->proxy(['http'], 'http://111.111.111.111:12345/')

      traffic goes through a proxy, as it should. So I need to make rotation work, somehow.

        Ok, I've asked you a few times to provide us with standalone code that shows the problem.

        You're failing to do so.

        Good luck with your program!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950403]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found