initial websocket code