简体   繁体   中英

Simulate HTTP request with jpcap

如何使用jpcap发送数据包以进行HTTP GET请求?

Is there any reason you can't use Java's http functionality?

URL url = new URL("http://www.test.com")
URLConnection conn = url.openConnection(); 

JPCAP is an interface and system for network packet capture.

Are you doing the full three-way handshake as required by TCP connections? I doubt jpcap takes care of this for you.

Unlike other pcap implementations, like libpcap and winpcap, jpcap does not have any functionality to send packets, only to capture them. If all you want to do is send an HTTP request with a user-defined source interface/IP, then have a look at this:

How can I specify the local address on a java.net.URLConnection?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM