Karan
Karan

Reputation: 497

Packet Capturing/Latency time in java

I am looking for HTTPS packet capturing code in java . But i am getting procedure for HTTP. As per our requirement we need HTTPS packet capturing code. Can anybody give me the link for that or would tell me where can I find it?.

Upvotes: 1

Views: 699

Answers (2)

iainmcgin
iainmcgin

Reputation: 2751

jNetPcap might be what you're looking for: it is a java wrapper around the native libpcap library that sarnold mentions. From the basic capture example provided, it seems that it would be fairly straightforward to write a PcapPacketHandler to time the arrival of packets on an HTTPS stream.

It will, however, add native dependencies to your project, which will complicate packaging up your software.

Upvotes: 2

sarnold
sarnold

Reputation: 104080

I would suggest starting with libpcap (or its sibling, winpcap on Windows), and then interpreting the saved captures; the libpcap team has done a fantastic job making a very reliable and fast mechanism to interface with the kernel's raw sockets support to run as efficiently as possible. (The Linux kernel provides a BPF-like interface for specifying which packets to offload to userspace; see Documentation/networking/filter.txt for Linux details.)

Upvotes: 1

Related Questions