title: using proxy with scrapy-splash
body: <p>I'm trying to use proxy (proxymesh) alongside scrapy-splash. I have following (relevant) code</p>
  
  <pre><code>PROXY = """splash:on_request(function(request)
      request:set_proxy{
          host = http://us-ny.proxymesh.com,
          port = 31280,
          username = username,
          password = secretpass,
      }
      return splash:html()
  end)"""
  </code></pre>
  
  <p>and in start_requests</p>
  
  <pre><code>def start_requests(self):
      for url in self.start_urls:
          print url
          yield SplashRequest(url, self.parse,
              endpoint='execute',
              args={'wait': 5,
                    'lua_source': PROXY,
                    'js_source': 'document.body'},
  </code></pre>
  
  <p>But it does not seem to work. self.parse is not called at all. If I change endpoint to  'render.html' I hit the self.parse method, but when I inspect headers (response.headers) I can see that it is not going trough proxy. I confirmed that when I set <a href="http://checkip.dyndns.org/" rel="noreferrer">http://checkip.dyndns.org/</a> as starting url and saw, upon parsing response, my old ip address.</p>
  
  <p>What am I doing wrong?</p>