MCPcopy
hub / github.com/bettercap/bettercap / OnResponse

Method OnResponse

modules/dns_proxy/dns_proxy_script.go:97–111  ·  view source on GitHub ↗
(req, res *dns.Msg, clientIP string)

Source from the content-addressed store, hash-verified

95}
96
97func (s *DnsProxyScript) OnResponse(req, res *dns.Msg, clientIP string) (jsreq, jsres *JSQuery) {
98 if s.doOnResponse {
99 jsreq := NewJSQuery(req, clientIP)
100 jsres := NewJSQuery(res, clientIP)
101
102 if _, err := s.Call("onResponse", jsreq, jsres); err != nil {
103 log.Error("%s", err)
104 return nil, nil
105 } else if jsres.CheckIfModifiedAndUpdateHash() {
106 return nil, jsres
107 }
108 }
109
110 return nil, nil
111}
112
113func (s *DnsProxyScript) OnCommand(cmd string) bool {
114 if s.doOnCommand {

Callers 1

onResponseFilterMethod · 0.45

Calls 3

ErrorFunction · 0.92
NewJSQueryFunction · 0.85

Tested by

no test coverage detected