0

How can send packet with jpcap for HTTP GET request?

2 Answers2

0

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.

Jayamohan
  • 12,734
  • 2
  • 27
  • 41
  • I want to send request with different source IP – user1929459 Dec 26 '12 at 09:38
  • You can specify the source interface for an HTTP request by doing this: http://stackoverflow.com/questions/91678/how-can-i-specify-the-local-address-on-a-java-net-urlconnection – Remy Lebeau Dec 26 '12 at 22:10
0

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?

Community
  • 1
  • 1
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770