thin layer on top of websockets with reconnection