emit 'close' signal when no more input data will be consumed

this allows client to know when the network data is completely transferred, before consuming it
add --info-port option that reports relevant statistics using HTTP and JSON