Http-recorder can be used for transparently recording all requests sent by any system via HTTP.
It is made of :
- An
HTTP endpoint
that accepts any kind of HTTP requests - A
API
to retrieve stored requests using a specific query syntax (see above).
Start recorder
./http-recorder -recorderPort 80 -retrieverPort 8080
Send any kinf of HTTP request on recorder port
Pop stored request(s) by querying them on retriever port, so simple !
Return the oldest request whose path contains 'banana'
http://hostname:23456?pathcontains=banana
Return the oldest request whose body contains 'store'
http://hostname:23456?pathcontains=store
Return the oldest request whose content type header is 'text/plain'
http://hostname:23456?contenttype=text%2Fplain
Return the oldest request whose method is 'PUT'
http://hostname:23456?method=put
NB : Query syntax ignores case.
Clone project
git clone https://github.com/BenC-/http-recorder.git
Build project
cd http-recorder
make install
Run http-recorder
bin/http-recorder -recorderPort 12345 -retrieverPort 23456
Start testing !
Http requests are stored in a FIFO implemented in an LRU way, to prevent uncontrolled memory increase.
REST API supports long polling HTTP
pattern, as proposed by IETF, using Request-Timeout header.
- Support more complete query syntax
- Provide HTML visualization of stored requests
- Adapt API to make it restful
- Support binary request and store base64 encoded body
The project is developed in Golang.
See the Golang documentation for more information about the language.
If you would like to submit pull requests, please feel free to apply.
- Golang
- Make