title: locust request return error 502 when hitting my local flask web app
body: <p>I am trying to create a locust test for load testting my flask app</p>
  
  <p>This is my locustfile.py</p>
  
  <pre><code>from locust import HttpLocust, TaskSet, task
  
  
  class DataBaseTest(TaskSet):
      def on_start(self):
          pass
  
      @task(1)
      def get_home(self):
          self.client.get("/")
  
  
  class WebsiteCassandra(HttpLocust):
      task_set = DataBaseTest
      min_wait = 5000
      max_wait = 9000
  </code></pre>
  
  <p>Running my flask web app in port 5000</p>
  
  <pre><code>app.run("0.0.0.0", 5000)
  </code></pre>
  
  <p>and in the directory where my locustfile.py lies</p>
  
  <pre><code>locust --host=http://127.0.0.1:5000
  </code></pre>
  
  <p>When I run the test I get the following failure</p>
  
  <pre><code>92  GET /   HTTPError(u'502 Server Error: Proxy Error ( Connection refused ) for url: http://127.0.0.1:5000/',)
  </code></pre>
  
  <p>Manually requesting the url works great. But not through locust. Why do you think it's that?</p>