volni
volni

Reputation: 5366

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?

Upvotes: 7

Views: 5410

Answers (1)

jman
jman

Reputation: 11606

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

Upvotes: 14

Related Questions