mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
new: implemented api.rest.record and api.rest.replay
This commit is contained in:
parent
4713d25ea7
commit
0a31ac8167
76 changed files with 7610 additions and 48 deletions
|
@ -111,7 +111,16 @@ func (p *EventPool) Add(tag string, data interface{}) {
|
|||
|
||||
// broadcast the event to every listener
|
||||
for _, l := range p.listeners {
|
||||
l <- e
|
||||
// do not block!
|
||||
go func(ch *chan Event) {
|
||||
// channel might be closed
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
|
||||
}
|
||||
}()
|
||||
*ch <- e
|
||||
}(&l)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ type ifaceJSON struct {
|
|||
Addresses []addrJSON `json:"addresses"`
|
||||
}
|
||||
|
||||
type sessionJSON struct {
|
||||
type SessionJSON struct {
|
||||
Version string `json:"version"`
|
||||
OS string `json:"os"`
|
||||
Arch string `json:"arch"`
|
||||
|
@ -59,7 +59,7 @@ type sessionJSON struct {
|
|||
}
|
||||
|
||||
func (s *Session) MarshalJSON() ([]byte, error) {
|
||||
doc := sessionJSON{
|
||||
doc := SessionJSON{
|
||||
Version: core.Version,
|
||||
OS: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue