This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |