Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I want to implement a server side application catching incoming http requests with a certain header.After catching the request it extracts information about type of HTTP request (GET,HEAD,PUT,POST etc.), requested url and sends it to another server, collecting the data ( a webservice or a server having a 3rd party tool like statsd).

Application needs to be as lightweight as possible.

On a side note corresponding server where the requests are coming to, will be in a high load, as a result application needs to perform well under such load. I know that this application can be implemented in any language, however I want to try something new.

Is node.js suitable for developing such an application regarding complexity and performance?

share|improve this question

1 Answer

up vote 1 down vote accepted

You can do package sniffing in Node.JS with the node_pcap package. It relies on libpcap. Though there is a port of libpcap in Windows, there might be some configuration that needs to be done in order to get it work in Windows.

When a network package is captured you can easily check if it is an http request with a certain header.

If that is too low level for you, you can also use http_trace that specifically traces http requests for you.

Here are some references to get you started:

share|improve this answer
node_pcap seems like what i need and easy to implement too. For performance evaluation i need to make some tests. Thank you for answer. – fga Dec 27 '12 at 6:19

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.