Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3600566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:30:42+00:00 2026-05-18T20:30:42+00:00

Is there any sample code that can report the url that my PC is

  • 0

Is there any sample code that can report the url that my PC is connecting with Java?

While I use my browser to connect to different sites and watch video online, it should capture the urls. Is it doable in Java?

I don’t want detailed traffic, just record the urls.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:30:43+00:00Added an answer on May 18, 2026 at 8:30 pm

    The fastest way is probably going to be to capture the output of the command-line tshark program (for at least windows and linux). This works on my linux box:

    sudo tshark -f 'port 80' -R 'http' -V | grep -A 1 '^Hypertext Transfer Protocol'
    

    And produces output like:

    Running as user "root" and group "root". This could be dangerous.
    Capturing on eth0
    Hypertext Transfer Protocol
        GET /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
        GET /posts/4494294/ivc/086e HTTP/1.1\r\n
    --
    Hypertext Transfer Protocol
        HTTP/1.1 204 No Content\r\n
    --
    Hypertext Transfer Protocol
        [truncated] GET /__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 get something similar for Windows. Experiment. How you get the output of tshark into java is up to you.

    If you want an all-java solution, how about http://jnetpcap.com/ ?

    You’re going to have to write (or use a library that provides) some platform specific JNI code.

    libpcap/WinPcap that jNetPcap uses provides this reliably on at least Windows and Linux from my experience. I have experience with libpcap/WinPcap but not with jNetPcap.

    tshark also uses libpcap/WinPcap actually.

    Either way, you’re going to see very many false positives. Opening a HTML page requires getting many, many images, style sheets, javascript libraries etc. The snippet above is from opening a stackoverflow.com page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any sample code that can report the url that my PC is
Is there any utility (or sample source code) that truncates HTML (for preview) in
Are there any sample applications avaliable that make use of both caliburn and prism?
Is there an Android equivalent of didUpdateHeading (from iOS) ? Any sample code to
Are there any tips for reading source code samples from manufacturer of MCUs'. I
In git, is there any (simple) way to modify the index so that only
Summary: I can run unit tests and code-coverage, but the report only includes NUnit
I am currently working on a Crystal Report wherein I use three different commands.
I am tyring to write some Java code that basically just plays a short
My input is javascript code that I can pre-process.. at some specific point in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.