title: Phantom.js / Casper.js with rotating proxy?
body: <p>I have a simple goal: load webpages with either <code>phantom.js</code> (out of the box) or <code>casper.js</code> (nice and easier) but <strong>using proxy and rotate it</strong> from a list if current one is bad (i.e. webpage loads fail or something like that).</p>
  
  <p>I know casper.js has <code>--proxy</code> param but it dictates the user to specify only ONE proxy and use it during runtime. </p>
  
  <p><strong>Question #1 is: how to rotate proxy on the fly programmatically?</strong></p>
  
  <p>I did some research and found this <a href="https://github.com/icodeforlove/node-requester" rel="noreferrer">node-requester</a> but it's not integrated with <code>casper.js</code>. I tried to extract out just the proxy feature in the <a href="https://github.com/icodeforlove/node-requester/blob/master/lib/requester.js" rel="noreferrer">code</a> but didn't really understand how it works in the nutshell (I am not that smart I guess). </p>
  
  <p><strong>So question #2: is there some simple implementation of proxy rotation that works with either <code>phantom.js</code> or <code>casper.js</code>?</strong> </p>
  
  <p>I prefer to use the fancy <code>casper.js</code> though but will go down with <code>phantom.js</code> bare as well.</p>