Featured post
networking - How to monitor my network connection with Java? -
is there sample code can report url pc connecting java?
while use browser connect different sites , watch video online, should capture urls. doable in java?
i don't want detailed traffic, record urls.
the fastest way going to capture output of command-line tshark
program (for @ least windows , linux). works on linux box:
sudo tshark -f 'port 80' -r 'http' -v | grep -a 1 '^hypertext transfer protocol'
and produces output like:
running user "root" , group "root". dangerous. capturing on eth0 hypertext transfer protocol /questions/4494294/r-gplots-barplots-how-to-fix-bar-width-independent-of-paper-setting http/1.1\r\n -- hypertext transfer protocol http/1.1 200 ok\r\n -- hypertext transfer protocol /posts/4494294/ivc/086e http/1.1\r\n -- hypertext transfer protocol http/1.1 204 no content\r\n -- hypertext transfer protocol [truncated] /__utm.gif?utmwv=4.8.6&utmn=20455052&utmhn=stackoverflow.com&utmcs=utf-8&utmsr=1600x1200&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r102&utmdt=graph%20-%20r%3a%20gplots%2c%20barplots%3a%20how%20to%20fix%20bar%20width%20i -- hypertext transfer protocol http/1.1 200 ok\r\n --
you should similar windows. experiment. how output of tshark java you.
if want all-java solution, how http://jnetpcap.com/ ?
you're going have write (or use library provides) platform specific jni code.
libpcap/winpcap jnetpcap uses provides reliably on @ least windows , linux experience. have experience libpcap/winpcap not jnetpcap.
tshark
uses libpcap/winpcap actually.
either way, you're going see many false positives. opening html page requires getting many, many images, style sheets, javascript libraries etc. snippet above opening stackoverflow.com page.
- Get link
- X
- Other Apps
Comments
Post a Comment