handle error on http reply
websocket support
refactor test
add  websocket test