Add support for dynamically generated response

This allows user to specify a function that generates the data, thus allowing to simulate things like sending frames from a video