Added option to pass a callback to each rule, which is called when the rule matched an incoming connection