Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple *nix tool for listening to HTTP requests and logging the request data

What's a simple, easy-to-use *nix tool that will listen to requests on a given port and log the request header and body?

like image 589
volni Avatar asked Dec 14 '11 21:12

volni


1 Answers

How about netcat?

sudo nc -l 80

Update: Here's what I see when I send a request through a browser.

[~]$ sudo nc -l 80
Password:
GET / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive
like image 141
jman Avatar answered Oct 02 '22 14:10

jman