implement communication with websockets