diff --git a/plugins.go b/plugins.go index a5a9113..9cd1136 100644 --- a/plugins.go +++ b/plugins.go @@ -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 { diff --git a/settings.go b/settings.go index fcdbc6f..a44aee1 100644 --- a/settings.go +++ b/settings.go @@ -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")