print socket error message
add ssl websockets
add heading
cleanup code