anchor.diff:  		message_parsing_error ->
   			<<"{\"ws_error\": \"Protocol message parsing error\"}">>;
   		_ ->
  -			{RequestMethod, Path, QueryString, ServerName, ServerPort} = Handler:request_info_for_message(ProtocolMessage),
  +			{RequestMethod, Path, QueryString, ServerName, ServerPort} = Handler:request_info_for_message(ProtocolMessage, HandlerState),
   			{ok, {Status, Headers, Body}} = perform_rack_request(RequestMethod, Path, QueryString, ServerName, ServerPort, ServerPath),
  -			Handler:encode_rack_response(Status, Headers, Body)
  +			Handler:encode_rack_response(Status, Headers, Body, HandlerState)
   	end,
  -	WSResponse = Handler:encode_transport_response(Response, ProtocolMessage),
  +	WSResponse = Handler:encode_transport_response(Response, ProtocolMessage, HandlerState),
       {reply, {text, WSResponse}, Req, State};
   
   websocket_handle(_Data, Req, State) ->
  
positive.code: init({tcp, http}, _Req, _Options) ->
    {upgrade, protocol, cowboy_websocket}.
  
  websocket_init(_TransportName, Req, Options) ->
  	Path = proplists:get_value(path, Options, "./priv"),
  	Handler = proplists:get_value(handler, Options),
    EventManager = proplists:get_value(event_manager, Options, undefined),
    State = #state{path = Path, handler = Handler, ws_handler_pid = self()},
    
    case EventManager of
      undefined -> ok;
      _ -> 
  
negative.code:   end,
    {ok, Req, State}.
   
  websocket_handle({text, Msg}, Req, #state{path = ServerPath, handler = Handler, ws_handler_state = HandlerState} = State) ->
  	ProtocolMessage = try Handler:parse_message(Msg, HandlerState)
  	catch 
  		_ -> message_parsing_error
  	end, 
  