title: PhantomJS, Capybara, Poltergeist failed to reach server
body: <p>I'm working with poltergeist for the first time, so I don't really know what I'm doing but I couldn't find any solution on the web. Please tell me if any information is missing.</p>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Capybara::Poltergeist::StatusFailError: Request failed to reach
    server, check DNS and/or server status</p>
  </blockquote>
  
  <p>this issue doesn't happen on production but only on development and staging environment.</p>
  
  <p>This line of code is the one that is making the trouble</p>
  
  <pre><code>phantomjs_options: ['--ignore-ssl-errors=yes', '--ssl-protocol=any', '--load-images=no', '--proxy=localhost:9050', '--proxy-type=socks5']
  </code></pre>
  
  <p>without '--proxy=localhost:9050' everything's working perfectly on every environment but I don't want to delete it in case it's critical for the production.</p>
  
  <p><strong>I've also noticed that on staging/development there's no 9050 port listening but on production there is one</strong></p>
  
  <p>full config code part (capybara_drivers.rb):</p>
  
  <pre><code>Capybara.register_driver :polt do |app|
    Capybara::Poltergeist::Driver.new(
        app,
        js_errors: false, # break on js error
        timeout: 180, # maximum time in second for the server to produce a response
        debug: false, # more verbose log
        window_size: [1280, 800], # not responsive, used to simulate scroll when needed
        inspector: false, # use debug breakpoint and chrome inspector,
        phantomjs_options: ['--ignore-ssl-errors=yes', '--ssl-protocol=any', '--load-images=no', '--proxy=localhost:9050', '--proxy-type=socks5']
  
    )
  end
  </code></pre>