I want to write a program which Controls all the web browsing activities on PC.
i.e. Checking 开发者_如何学Call the websites users go to, filtering some of them, ... .But I have no idea how to capture all the packets, processing them, and even act to some (think of filtering unwanted sites).
Any help, sample code, open source program...?
There are different levels you can put yourself in the middle of the communication:
- By implementing a proxy and having the browser connect to the proxy
- By implementing a firewall/snooper and handling the raw packets
- By implementing a network driver and handling the raw packets
IMHO, number 1 is easiest. Look at SQUID for an example. Number 2 is doable too, take a look at fiddler. You could take a look at the Click Modular Router for option number 3.
Depending on the browser, maybe a simple browser plugin could do?
精彩评论