I have a daemon, call it whatverd
, running on TCP port 11111. It is basically an http server, but it does not do any kind of logging or debugging. It only returns query results via JSON in the http(s) response, like a normal web server. How can I capture and write http(s) requests and responses to a local file? My options seem to be:
- Modify the source code, in a language I don't know at all.
- Run an http proxy of some sort.
- Run
tcpdump
and redirect the output to a file.
Is there an obvious 'right' way to do this? Thanks.
PS: It's running on Debian Jessie (8), I do have root, and I can modify the TCP port number that whateverd
listens on.
whateverd
on TCP 111111. The return path would also have to go through the proxy. I just can't tell if this is a job for apache, squid, or something like tinyproxy. – Luke Sheppard Jul 07 '18 at 05:49whateverd
here. Apache, Nginx, tinyproxy, and maybe squid should all be able to do this, although I think that tinyproxy and squid are slightly more designed to be forward proxies. – Lucy Maya Menon Jul 07 '18 at 18:59