Add after filter into the filter chain.
filter instance or filter function.
Do after filter chain. Give server a chance to do clean up jobs after request responsed. After filter can not change the request flow before. After filter should call the next callback to let the request pass to next after filter.
error object
session object for current request
response object send to client
cb(err) callback function to invoke next chain node
Add before filter into the filter chain.
filter instance or filter function.
Do the before filter. Fail over if any filter pass err parameter to the next function.
clienet request msg
a session object for current request
cb(err) callback function to invoke next chain node
Filter service. Register and fire before and after filters.