pgaref / HTTP_Request_Randomizer

Proxying Python Requests
http://pgaref.com/blog/python-proxy/
MIT License
148 stars 60 forks source link

Added debug control, fixed header update bug, added proxy sustain #20

Closed glen-mac closed 7 years ago

glen-mac commented 7 years ago

Added ability to sustain a proxy. This may be required if a user needs to perform a GET request, parse a page for CSRF and then POST a form. Once this is done the user may call RequestProxy.randomize() proxy to change the proxy. This is disabled by default using the argument 'sustain' when creating the RequestProxy instance. If sustain is enabled - the proxy will still be randomised if the current proxy times out. The user is able to disable sustain at any time using Instance.sustain, and can get the address of the current proxy using Instance.current_proxy. If sustain is disabled then the proxy is randomised on each request

added ability to disable proxy messages. These messages are enabled by default but there is now an argument when creating RequestProxy instance to mute them. Although can be toggled at any time using Instance.debug

fixed issue with headers not actually being updated, due to {}.update() not returning the updated dictionary. Call for update done before use and now works

pgaref commented 7 years ago

Cool stuff! Really useful! I am only sceptical about the debug level being a class attribute - would it make sense to use logging instead? Then the user could pick the right logging level for his needs.

glen-mac commented 7 years ago

Good idea - Are you referring to https://docs.python.org/2/library/logging.html ?

pgaref commented 7 years ago

Yes, pythons' standard logging library is quite powerful.