79 Commits
Author SHA1 Message Date
Dima GolomozyandGitHub 40946831b9 goreplay-cli package (#1148)
change package from `main -> goreplay`
this will allow importing `goreplay` as a package
2023-01-12 18:24:45 +03:00
18f33fb4f7 introduce freecache to avoid golang map OOM (#1039)
Co-authored-by: wangfeng115 <wangfeng115@ke.com>

Using the freecache library to avoid golang map OOM. As follows
https://github.com/golang/go/issues/20135
2022-02-12 10:12:33 +03:00
Leonid Bugaev 625ed54f1e Allow input file read ahead
Input file now pre-reads N requests, sort them by timestamp and emit on demand.
You can control read depth using --input-file-read-depth which is 100 by default.

It makes implementaiton faster, and it fix various issues when due to concurrenccy, or another issues requests gets addeed out of order.
2021-07-08 10:30:22 +03:00
Urban Ishimwe ec4dbf2061 appropriate emitter close 2020-11-06 17:35:33 +02:00
Urban Ishimwe 6d812ceb7f changes plugins reader and writer method
// PluginReader is an interface for input plugins
type PluginReader interface {
	PluginRead() (msg *Message, err error)
}

// PluginWriter is an interface for output plugins
type PluginWriter interface {
	PluginWrite(msg *Message) (n int, err error)
}
2020-11-02 06:15:10 +02:00
Urban IshimweandGitHub fdc8b094f0 Benchmarking, packaging, and fix issues, tests and perfomance (#797)
### performance
- handling of the very big packet(any size that can be buffered)
- speeding up TCP sessions by using message hints: Added **proto.HasFullPayload** that helps to validate the entire HTTP request, it supports `Chunked` encoding too! Added **proto.HasRequestTitle** and **proto.HasResponseTitle** for validating the beginning of HTTP request. Those methods are used `input_raw.go` with `TCP`.
- supports Keep-Alive: the above functions helps to support keep-alive

### Packaging
- **capture:** engines(capture/doc.go)
- **tcp:** tcp message parser (tcp/doc.go)

### benchmarking
- **capture.BenchmarkPcapDump:** the benchmarks regarding dumping packets in a pcap file
- **capture.BenchmarkPcapFile:** the benchmarks of reading packets from a pcap file
- **capture.BenchmarkPcap:** the benchmarks of parsing packets from the loopback interface with pcap handles
- **proto.BenchmarkHasFullPayload:**: benchmarking this function which validates the HTTP payload
- **tcp.BenchmarkPacketParseAndSort:** benchmarks of parsing and sorting packets
- **tcp.BenchmarkMessageParserWithoutHint:** benchmarks of message reasembling by using `SYN` and `FIN` flag
- **tcp.BenchmarkMessageParserWithHint:** benchmarks of message reasembling by using `proto.HasRequestTitle` and `proto.HasFullPayload` flag

### issues
see linked issues

###  tests
- fixed input raw and engine tests

**Most of the changed of the files, was about using functionalities of** `tcp` **and** `capture` **in existing functionalities**
2020-08-11 12:44:53 +03:00
arijitad 80b19f918b Map Appsetting to flag names. 2020-07-15 00:14:38 +05:30
Urban Ishimwe 39b1f80457 Merge branch 'master' into pro-merge 2020-06-16 22:43:08 +02:00
Arijit Das 60d949a243 Fix test. 2020-06-12 00:02:36 +05:30
Arijit Das 28688e29e8 Fix test. 2020-06-11 21:13:37 +05:30
Arijit Das e9bbc252e0 Fix input raw test and go fmt. 2020-06-11 20:34:09 +05:30
Arijit Das 73e26d48d9 Fix CI comments. 2020-06-11 19:24:38 +05:30
Arijit Das 1c87a339a5 Address comments. 2020-06-11 19:21:31 +05:30
Leonid Bugaev 540e42b9d4 Add more PRO protection 2020-06-08 14:35:38 +03:00
Leonid Bugaev d67bc13db3 Merging PRO functionality back to OSS repo 2020-06-08 14:29:32 +03:00
Arijit Das db28858804 Refactor emitter.go and fix test accordingly. 2020-06-06 16:00:43 +05:30
Arijit Das 8c1a194a51 Addressed comment. 2020-06-02 22:54:02 +05:30
Arijit Das aa1eb9f8b7 Address comment. 2020-06-02 12:20:19 +05:30
Arijit Das c1f14e8cfb Add comment. 2020-06-01 15:19:32 +05:30
Arijit Das 21e0a2f8c2 Close channel once. 2020-06-01 15:18:13 +05:30
Arijit Das 803257c710 Timeout blocking read call. 2020-06-01 15:07:11 +05:30
Arijit Das 28899ea1e1 Wait for go routine to close in emitter.go. 2020-06-01 01:14:47 +05:30
Romanenko AlexeyandGitHub 2d78f195d2 Make plugin not global. Revert last-chunk bytes to correct value (#755)
Make Plugins variable not global to fix concurrency in test
Revert last-chunk in chunked transfer coding to correct value (https://tools.ietf.org/html/rfc2616#section-3.6.1) fyi @bruce34
2020-05-27 21:03:40 +03:00
Romanenko AlexeyandGitHub 11bd20f251 fix tests; fix build for dev (#751)
* fix golang version in Dockerfile
* remove webupd8team launchpad
* add install default java (jre and jdk)
* fix unit tests
2020-05-21 13:59:46 +03:00
frank-dingandLeonid Bugaev ffc1a09ca1 fix: specified multi input, but only enable the last one (#700)
capture traffic on more than one port(e.g. --input-raw :80 --input-raw :81 --input-raw :82), but only listens on the last specified port"
2019-11-01 17:00:47 +03:00
Leonid Bugaev c48d07d2c6 Merge remote-tracking branch 'upstream/master' 2019-03-29 22:45:27 +07:00
bruce34andLeonid Bugaev 6f70a939f4 Add setting for copyBufferSize, defaults to 5 Mbytes (#630) 2019-02-16 09:34:53 +01:00
Leonid Bugaev 85c6070775 File output now case limit by size
Added new `output-file-max-size-limit` option
2019-02-16 08:49:31 +01:00
Leonid Bugaev 166c8e8d87 Merge remote-tracking branch 'upstream/master' 2018-08-24 16:35:39 +05:00
Leonid Bugaev 52ed8b4d1e Add protection for malformed records 2018-08-24 16:35:04 +05:00
Leonid Bugaev e9294aeb5f Fix emitter typo 2018-05-10 22:18:47 +03:00
UbuntuandLeonid Bugaev a65256d707 Fixed kafka client run of brokers and index out of range issues 2018-02-27 20:17:45 +03:00
Leonid Bugaev 06ec570286 Merge remote-tracking branch 'upstream/master' 2017-07-20 21:09:04 +03:00
Leonid Bugaev aa4a878436 Handle gzip encoding error
Fix #470
2017-06-24 20:35:35 +02:00
Leonid Bugaev 1a32de3dc6 Merge branch 'master' of https://github.com/buger/gor 2017-01-23 20:04:33 +03:00
Leonid BugaevandGitHub d66ba0353a Prettify http (#418)
Prettify HTTP
2017-01-23 21:02:26 +04:00
Leonid BugaevandGitHub 8c16220532 Track http responses (#416) 2017-01-23 16:20:27 +04:00
Leonid Bugaev 043c0b7436 few fmt fixes 2017-01-23 13:33:36 +03:00
Leonid Bugaev 973b028517 Merge branch 'master' into s3 2017-01-23 13:27:56 +03:00
Leonid Bugaev b48aadc9ea Merge branch 'master' of https://github.com/buger/gor 2017-01-20 22:37:11 +03:00
Leonid Bugaev be49c7e7ac Run GC on each 1000th request 2016-12-23 20:25:09 +03:00
Leonid Bugaev 92b02e4af4 Fmt 2016-12-23 19:56:33 +03:00
Sergey Mostovoy 5b5c3f33f4 Filter response if request is filtered #388 2016-12-22 11:25:29 +02:00
Leonid Bugaev bc1a6c9524 Merge branch 'master' of https://github.com/buger/gor 2016-12-19 14:22:41 +03:00
Alexandr Korsak e3a9a9b2c2 Add kafka output 2016-10-31 19:04:05 +03:00
Leonid BugaevandGitHub 7e245dfb18 Merge pull request #2 from buger/tcp-sessions
Add support for tcp sessions
2016-07-31 20:28:42 +03:00
Leonid Bugaev a4826fcff9 Add support for tcp sessions 2016-07-30 16:42:40 +03:00
Leonid Bugaev dae6a8915d Refactor exit-after 2016-07-08 19:27:20 +03:00
Leonid Bugaev 19bfb8211c Use latest libpcap and ensure to close sockets 2016-05-13 14:33:20 +05:00
Leonid Bugaev 661dd2026f Fix grouting spawn loop and memory leaks 2015-09-01 20:27:26 +03:00