zlorb / locust.replay

Record and playback Locust.io tests with MITMproxy
58 stars 16 forks source link

Compatibility with Mitmproxy version: 2.0.2 #5

Closed AronNovak closed 6 years ago

AronNovak commented 6 years ago

MITMproxy

Mitmproxy version: 2.0.2 (release version) Precompiled Binary
Python version: 3.5.2
Platform: Linux-4.13.13-200.fc26.x86_64-x86_64-with-fedora-26-Twenty_Six
SSL version: OpenSSL 1.1.0e  16 Feb 2017
Linux distro: Fedora 26 Twenty Six

The command:

./mitmdump --anticache -s "locust_extractor.py projectname"

The error:

Proxy server listening at http://0.0.0.0:8080
127.0.0.1:43836: clientconnect
Script error: Traceback (most recent call last):
  File "locust_extractor.py", line 139, in request                                                                                                    
    context.locusts.add(flow.request.host, flow)                                                                                                      
  File "locust_extractor.py", line 105, in add                                                                                                        
    self.__locusts__[host] = self.__locust_code(flow)                                                                                                 
  File "locust_extractor.py", line 77, in __locust_code                                                                                               
    if flow.request.body:                                                                                                                             
AttributeError: 'HTTPRequest' object has no attribute 'body'                                                                                     
dannyOhNo commented 6 years ago

Bump

stefankahn commented 6 years ago

Bump. I would also like to see a solution to this.

zlorb commented 6 years ago

To resolve, code need to be updated to Python3 & MITMProxy2. Looking into this.

zlorb commented 6 years ago

... planning to skip ahead to soon-to-be-released MITMProxy v3

zlorb commented 6 years ago

Resolved for mitmproxy v3 and v4. Tested with v4.0.1 only.