implement websocket with c