anchor.diff:  		 {<<"Sec-WebSocket-Location">>, Location},
   		 {<<"Sec-WebSocket-Origin">>, Origin}],
   		Challenge, Req#http_req{resp_state=waiting}),
  -	handler_loop(State#state{messages=Transport:messages()},
  +	handler_before_loop(State#state{messages=Transport:messages()},
   		Req2, HandlerState, <<>>).
   
   -spec websocket_location(atom(), binary(), inet:ip_port(), binary())
  
positive.code: 	challenge = undefined :: undefined | binary(),
  	timeout = infinity :: timeout(),
  	messages = undefined :: undefined | {atom(), atom(), atom()},
  	eop :: tuple()
  }).
  
  -spec upgrade(module(), any(), #http_req{}) -> ok.
  
negative.code: 				Rest, {websocket, Frame}, fun websocket_data/4);
  		nomatch ->
  			%% @todo We probably should allow limiting frame length.
  			handler_before_loop(State, Req, HandlerState, Data)
  	end;
  websocket_frame(State, Req, HandlerState, _Data, _FrameType) ->
  	websocket_close(State, Req, HandlerState, {error, badframe}).
  