title: CasperJS: Configure proxy options inside code
body: <p>I was wondering how we could set cli parameters inside our code and not by placing them at the end of our command like this:</p>
  
  <pre><code>casperjs casper_tor.js --proxy=127.0.0.1:9050 --proxy-type=socks5
  </code></pre>
  
  <p>I've tested things like that but it didn't work:</p>
  
  <pre><code>var casper=require('casper').create();
  
  casper.cli.options["proxy"] = "127.0.0.1:9050";
  casper.cli.options["proxy-type"] = "socks5";
  ...
  casper.run();
  </code></pre>
  
  <p>What I'm trying to achieve is to set new proxies inside my code and to scrap my new ip address from whatsmyip.com to check that everything is right (I'm writing bots that will frequently change their proxies).</p>