anchor.diff:      {stop,normal,State1}.
   
   %% Start handshake
  +handle_info(timeout, #state{server={Host,Port,Path}} = State) ->
  +    
  +    case gen_tcp:connect(Host,Port,
  +                         [binary,{packet, http},{active,true}], 2000) of
  +        {ok, Sock} ->
  +            Req = initial_request(Host,Path),
  +            ok = gen_tcp:send(Sock,Req),
  +            inet:setopts(Sock, [{packet, http}]),
  +            {noreply, State#state{socket=Sock}};
  +        {error, timeout} ->
  +            {stop, connection_timeout, State}
  +    end;
   handle_info({http,Socket,{http_response,{1,1},101,_Status}}, State) ->
       State1 = State#state{readystate=?CONNECTING,socket=Socket},
       {noreply, State1};
  
positive.code: 
  init([Mod,Host,Port,Path]) ->
      ModState = Mod:ws_init(),
      {ok, Sock} = gen_tcp:connect(Host,Port,[binary,{packet, http},{active,true}], 1000),
      Req = initial_request(Host,Path),
      ok = gen_tcp:send(Sock,Req),
      inet:setopts(Sock, [{packet, http}]),
      {ok,#state{socket=Sock, callback=Mod, callback_state=ModState}}.
  
  
  %% Write to the server
  write(Pid, Data) ->
  
negative.code:     undefined.
  
  -record(state, {socket,readystate=undefined,headers=[],callback, callback_state,
                  server,
                  sofar = <<>>}).
  
  start_link(Mod,Host,Port) ->
  