adapted writting parser to WebSocket stream