Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running Node.js. But for some reason, requests are not being caught by the server. (http://stackoverflow.com/questions/9247482/node-js-server-not-receiving-ajax-requests)

Is there any way to check if there's an HTTP request coming in? Ideally, I want to run something that will "listen" for HTTP request, and then prints them as they come in, along with the URl of that http request (if possible)

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

The standard tool would just be to install and run tcpdump.

A capture filter like this. tcpdump -qn -s 0 -A port 80 would capture and print the every packet destined for port 80 on that system. See the man pages, tcpdump is extremely flexible.

share|improve this answer
add comment

I like Zoredache's answer of tcpdump as it is really a standard tool, you can also try out ngrep.

First you install it with:

apt-get install ngrep

Then you can use it to filter network streams looking for certain keywords like GET.

ngrep -W byline 'GET' 'port 80'
  • -W byline is here to make it look prettier
  • GET is the keyword we are looking for
  • port 80 can be replaced with bpf expression (e.g. ones used with tcpdump)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.