add multithread support to merging tcp http script