added websockets compatibility