mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
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:
committed by
Leonid Bugaev
parent
ae4a6259c2
commit
ffc1a09ca1
+4
-4
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user