From ec6483faffb68f0e0882de9bc83aa715e3dc0b09 Mon Sep 17 00:00:00 2001 From: frank-ding <454211569@qq.com> Date: Fri, 1 Nov 2019 22:00:47 +0800 Subject: [PATCH] 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" --- emitter.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/emitter.go b/emitter.go index 9cb150f26..16658d917 100644 --- a/emitter.go +++ b/emitter.go @@ -31,22 +31,22 @@ func Start(stop chan int) { }() } else { for _, in := range Plugins.Inputs { - go func() { + go func(in io.Reader) { if err := CopyMulty(in, Plugins.Outputs...); err != nil { log.Println("Error during copy: ", err) close(stop) } - }() + }(in) } for _, out := range Plugins.Outputs { if r, ok := out.(io.Reader); ok { - go func() { + go func(r io.Reader) { if err := CopyMulty(r, Plugins.Outputs...); err != nil { log.Println("Error during copy: ", err) close(stop) } - }() + }(r) } } }