Skip to content

ngmoco/http_replay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

HTTP Replay

This project listens on TCP port 5665 for a streamed pcap file containing HTTP requests. It minimally tries to build the packets into a request and then forwards them localhost:8081.

Expect lots of bad HTTP requests because requests that are split over multiple packets will be truncated unless the packets come in-order. This worked well enough for my testing needs.

Dependencies

gopcap

Install libpcap (tcpdump)
go get github.com/akrennmair/gopcap

Capture

on linux as root to capture port 80:
tcpdump -s 0 -w - -ieth0 "dst port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | tee live_dump.pcap | nc myhost 5665

The tcpdump filter above discards non-data packets. The tee command writes the pcap data to a file and may be omitted. The nc command forwards the pcap data over the network to the host running httpreplay.

Replay pcap file

nc myhost 5665 < live_dump.pcap

About

Quick and dirty HTTP replay utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages