packet:SetData(...) to replace the
payload or packet:Block() to drop the packet entirely.
Parameters
function
required
Called as
callback(packet) before each packet is sent.Behavior
SetDataandBlockwork only here. They are valid while a send hook is running and raise otherwise.- Blocking stops the chain. Once a hook blocks a packet, later hooks are not called for it.
- A replacement payload must fit the capture limit, otherwise
SetDataraises. - Errors are contained: a raising hook is logged and the packet proceeds.
Example
Errors
Related
remove_send_hook: remove it.on_send: passive observation instead.