Hi Vlad On Fri, 4 Dec 2020 at 02:11, Vlad Petric <v...@petric.cc> wrote:
> Hi Everyone, > > I'd like to randomly inject 400 errors via the HTTP Proxy. > > I'm testing the robustness of an application that performs a lot of HTTP > GETs. I am using the basic http web proxy, and I need to modify it to > randomly insert some errors. > > Should I be using my own class derived from ProxyRequest, and override > process()? If that's the case, how would I be injecting 400s? > > Thank you so much! > Vlad, a twisted n00b > _______________________________________________ > Is this a forward or reverse proxy? ProxyRequest is just like any request... you can set headers, response code, write content to it... Here is an example: https://gist.github.com/adiroiban/ef9dfd2cce5c59b70e1bc0600b58adeb -- Adi Roiban
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python