record tcp stream and replay for server test