anchor.diff:    {ok,NewRouter} = erwa_protocol:forward_messages(Messages,Router),
     {ok,State#state{router=NewRouter,buffer=NewBuffer}}.
   
  --ifdef(TEST).
  +
  +find_supported_protocol([]) ->
  +  unsupported;
  +find_supported_protocol([?WSJSON|_T]) ->
  +  json;
  +find_supported_protocol([?WSMSGPACK|_T]) ->
  +  msgpack;
  +find_supported_protocol([_|T]) ->
  +  find_supported_protocol(T).
   
   
   
   
  +
  +-ifdef(TEST).
  +
  +header_find_test() ->
  +  json = find_supported_protocol([?WSJSON_BATCHED,?WSJSON]).
  +
  +
   -endif.
  
positive.code:   Reply =
      case Enc of
        json -> {text,Rpl};
        json_batched -> {text,Rpl};
        msgpack -> {binary,Rpl};
        msgpack_batched -> {binary,Rpl}
      end,
  	{reply,Reply,Req,State};
  websocket_info(_Data, Req, State) ->
  
negative.code: websocket_init(_TransportName, Req, _Opts) ->
    % need to check for the wamp.2.json or wamp.2.msgpack
    {ok, Protocols, Req1} = cowboy_req:parse_header(?SUBPROTHEADER, Req),
    case find_supported_protocol(Protocols) of
        unsupported ->
          {shutdown,Req1};
        Enc ->
          Req2  = cowboy_req:set_resp_header(?SUBPROTHEADER,?WSMSGPACK,Req1),
          {ok,Req2,#state{enc=Enc}}
    end.
  
  
  websocket_handle({text, Data}, Req, #state{enc=json}=State) ->
    {ok,NewState} = handle_wamp(Data,State),
    {ok,Req,NewState};
  websocket_handle({binary, Data}, Req, #state{enc=msgpack}=State) ->
    {ok,NewState} = handle_wamp(Data,State),
    {ok,Req,NewState};
  websocket_handle(Data, Req, State) ->
  