anchor.diff:                                 Req).
   
   do_init(Req, Access, Iorio, IorioState, Active) ->
  -    {Token, Req1} = cowboy_req:qs_val(<<"jwt">>, Req, nil),
  -    {Params, Req2} = cowboy_req:qs_vals(Req1),
  +    {Token, Req0} = cowboy_req:qs_val(<<"jwt">>, Req, nil),
  +    {Params, Req1} = cowboy_req:qs_vals(Req0),
  +    {ConnType, Req2} = connection_type(Req1, Active),
  +
       Req3 = cowboy_req:compact(Req2),
       RawSubs = proplists:get_all_values(<<"s">>, Params),
       Subs = iorio_parse:subscriptions(RawSubs),
  
positive.code: -include("include/iorio.hrl").
  
  -record(state, {channels=[], iorio_mod, iorio_state, token, info, access,
                  active}).
  
  % TODO: handle CORS in COMET on bullet?
  init(_Transport, Req, Opts, Active) ->
      {access, Access} = proplists:lookup(access, Opts),
      {iorio_mod, Iorio} = proplists:lookup(iorio_mod, Opts),
      {iorio_state, IorioState} = proplists:lookup(iorio_state, Opts),
      {Method, Req1} = cowboy_req:method(Req),
      case Method of
          <<"GET">> -> do_init(Req1, Access, Iorio, IorioState, Active);
  
negative.code:             iorio_stats:listen_connect(Active),
              State = #state{channels=[], iorio_mod=Iorio,
                             iorio_state=IorioState, access=Access, token=Token,
                             info=Info1, active=Active, conn_type=ConnType},
  
              State1 = subscribe_all(Subs, State),
              Req4 = if Active == once -> set_json_response(Req3);
  