new: http and https proxy modules can now define an onCommand callback to handle custom session commands (closes #182)

This commit is contained in:
evilsocket 2018-03-19 18:02:43 +01:00
commit 86ba73f5bb
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 59 additions and 5 deletions

View file

@ -144,6 +144,13 @@ func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, scrip
log.Debug("Applied redirection %s", p.Redirection.String())
p.sess.UnkCmdCallback = func(cmd string) bool {
if p.Script != nil {
return p.Script.OnCommand(cmd)
}
return false
}
return nil
}
@ -323,6 +330,8 @@ func (p *HTTPProxy) Stop() error {
p.Redirection = nil
}
p.sess.UnkCmdCallback = nil
if p.isTLS == true {
p.isRunning = false
p.sniListener.Close()