Java TCP Socket Sniffing

2020-06-17 06:56发布

I am using TCP sockets to communicate data between a server and client program using a specific port number on the same computer (localhost).

I need a software that can capture the data being sent/received through that socket?

(or)

What's the simplest way of sniffing packets from a specified port in Java?

7条回答
兄弟一词,经得起流年.
2楼-- · 2020-06-17 07:40

You can use tcpdump that gives you a variety of options. You save the capture in a .pcap file with the -w option and when you are done you open that file with wireshark. The advantage of this way is that you can capture a high rate of packets per second without affecting the overall performance of your pc (even if it is low end).

查看更多
登录 后发表回答