Skip to content

Instantly share code, notes, and snippets.

@Sandyroy95
Sandyroy95 / ISSUES WITH LOCUST
Created September 6, 2016 18:42
Hi everyone, I am currently working on a project in Locust where I have to perform a simple GET/POST operation through a proxy. I have got the entire script ready.However im having some trouble getting it through a proxy. I have tried a number of traditional python methods such as 'export HTTP_PROXY" or urllib2.ProxyHandler' but it's been of no …
class UserBehavior(TaskSet):
def on_start(self):
self.login()
def login(self):
proxy_support = urllib2.ProxyHandler({"https":"https://xxxxxxxxxxx"})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
Hi everyone,
I am currently working on a project in Locust where I have to perform a simple GET/POST operation through a proxy. I have got the entire script ready.However im having some trouble getting it through a proxy. I have tried a number of traditional python methods such as 'export HTTP_PROXY" or urllib2.ProxyHandler' but it's been of no avail.
I am attaching a segment of my code to show my current approach:
***********************************************************************************
class UserBehavior(TaskSet):
def on_start(self):
self.login()