Skip to content

Commit

Permalink
fix: specified multi input, but only enable the last one (#700)
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
pourer authored and buger committed Nov 1, 2019
1 parent 00a9e72 commit ec6483f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions emitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit ec6483f

Please sign in to comment.