jbittel / httpry

HTTP logging and information retrieval tool

Home Page:dumpsterventures.com/jason/httpry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can httpry intercept http requests

olivernn opened this issue · comments

Is it possible to intercept an http request using httpry and respond with a previously saved response?

I want a way to get integration tests running quicker and less dependent on external services. Basically I want to run tests once, record all the responses of external http requests and then the next time the tests are run just return these saved responses instead of going off to the network.

Something similar to https://github.com/myronmarston/vcr but at a lower level?

httpry is designed to be entirely passive, so it's not able to intercept or reply to HTTP requests. You can use the -b switch to write a pcap file of the HTTP traffic you're interested in, and then use something like Tcpreplay to replay the traffic back onto the network. However, based on your description, I'm not sure that's a solution for your problem as you want to trigger the replay off of live traffic.