Add new option --input-raw-expire to configure TCP message expiration

This commit is contained in:
Leonid Bugaev
2017-03-17 15:23:57 +01:00
parent 375538263b
commit 6ea23de38b
2 changed files with 4 additions and 2 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ import (
"reflect"
"strings"
"sync"
"time"
)
// InOutPlugins struct for holding references to plugins
@@ -107,7 +106,7 @@ func InitPlugins() {
}
for _, options := range Settings.inputRAW {
registerPlugin(NewRAWInput, options, engine, Settings.inputRAWTrackResponse, time.Duration(0), Settings.inputRAWRealIPHeader)
registerPlugin(NewRAWInput, options, engine, Settings.inputRAWTrackResponse, Settings.inputRAWExpire, Settings.inputRAWRealIPHeader)
}
for _, options := range Settings.inputTCP {
+3
View File
@@ -50,6 +50,7 @@ type AppSettings struct {
inputRAWEngine string
inputRAWTrackResponse bool
inputRAWRealIPHeader string
inputRAWExpire time.Duration
middleware string
@@ -117,6 +118,8 @@ func init() {
flag.StringVar(&Settings.inputRAWRealIPHeader, "input-raw-realip-header", "", "If not blank, injects header with given name and real IP value to the request payload. Usually this header should be named: X-Real-IP")
flag.DurationVar(&Settings.inputRAWExpire, "input-raw-expire", time.Second*2, "How much it should wait for the last TCP packet, till consider that TCP message complete.")
flag.StringVar(&Settings.middleware, "middleware", "", "Used for modifying traffic using external command")
// flag.Var(&Settings.inputHTTP, "input-http", "Read requests from HTTP, should be explicitly sent from your application:\n\t# Listen for http on 9000\n\tgor --input-http :9000 --output-http staging.com")