Creates an adapter for websocket API.