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"
This commit is contained in:
frank-ding
2019-11-01 17:00:47 +03:00
committed by Leonid Bugaev
parent ae4a6259c2
commit ffc1a09ca1
+4 -4
View File
@@ -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)
}
}
}