anchor.diff:    end.
   
   wait(_Socket)->
  -  false.
  +      ok.
  +
  +stop(Socket, From)->
  +  gen_tcp:close(Socket),
  +  From ! {stoppend, self()},
  +  exit(normal).
   
   %get_header_value(Key, Headers) ->
     %proplists:get_value(Key, Headers).
  
positive.code: 
  spec() ->
    describe("wsecli", fun() ->
          it("should open a tcp connection to the desired Host", fun() ->
                start_http_server(self(), 8080),
                meck:new(gen_tcp, [unstick, passthrough]),
  
                Host = "localhost",
  
negative.code:   {ok, Listen} = gen_tcp:listen(Port, [{reuseaddr, true}, {packet, raw}, binary]),
    spawn_link(fun() -> accept(Tester, Listen) end).
  
  stop_http_server(Server) ->
    Server ! {stop, self()},
    receive
      {stopped, Server} ->
        ok
    end.
  
  accept(Tester, Listen) ->
    receive
      {stop, From} ->
        stop(Listen, From)
      after 100 -> true
    end,
  
    case gen_tcp:accept(Listen, 100) of
      {ok, Socket} ->
        handshake(Tester, Socket);
      {error, timeout} ->
        accept(Tester, Listen)
    end.
  
  handshake(Tester, Socket) ->
    receive
      {stop, From} ->
        stop(Socket, From);
      {tcp, Socket, Data } ->
        {ok, {http_request, Method, Uri, Version}, Rest} = erlang:decode_packet(http, Data, []),
  
  