Generic Web Socket Implementation.