fix: fixed a json encoding issue that caused the api.rest controller to return an empty list of events when a net.sniff http event is triggered

This commit is contained in:
evilsocket 2018-09-27 16:09:11 +02:00
commit 0ada0fdf7b
4 changed files with 46 additions and 16 deletions

View file

@ -10,12 +10,12 @@ import (
type SniffData map[string]interface{}
type SnifferEvent struct {
PacketTime time.Time
Protocol string
Source string
Destination string
Message string
Data interface{}
PacketTime time.Time `json:"time"`
Protocol string `json:"protocol"`
Source string `json:"from"`
Destination string `json:"to"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
func NewSnifferEvent(t time.Time, proto string, src string, dst string, data interface{}, format string, args ...interface{}) SnifferEvent {