anchor.diff:      end.
   
   
  -
  -
  -
  +%% @doc Parses an url that can use a Proto+Transports or uses Transport as Scheme
  +-spec parse_urls(atom(), [atom()], term()) ->
  +    {ok, [{[raw_connection()], map()}]} |
  +    {error, term()}.
  +
  +parse_urls(Proto, Transports, Url) ->
  +    case nklib_parse:uris(Url) of
  +        error ->
  +            {error, invalid_url};
  +        List ->
  +            case do_parse_urls(Proto, Transports, List, []) of
  +                error ->
  +                    {error, invalid_url};
  +                List2 ->
  +                    multi_resolve(List2, #{resolve_type=>listen})
  +            end
  +    end.
  +
  +
  +
  +%% @private
  +do_parse_urls(_Proto, _Transports, [], Acc) ->
  +    lists:reverse(Acc);
  +
  +do_parse_urls(Proto, Transports, [#uri{scheme=Proto, opts=Opts, ext_opts=ExtOpts}=Uri|Rest], Acc) ->
  +    Transp1 = case nklib_util:get_value(<<"transport">>, Opts) of
  +        undefined ->
  +            nklib_util:get_value(<<"transport">>, ExtOpts);
  +        T1 ->
  +            T1
  +    end,
  +    Transp2 = (catch nklib_util:to_existing_atom(Transp1)),
  +    case Transp2==undefined orelse lists:member(Transp2, Transports) of
  +        true ->
  +            do_parse_urls(Proto, Transports, Rest, [Uri|Acc]);
  +        false ->
  +            error
  +    end;
  +
  +do_parse_urls(Proto, Transports, [#uri{scheme=Sc, ext_opts=Opts}=Uri|Rest], Acc) ->
  +    case lists:member(Sc, Transports) of
  +        true ->
  +            Uri2 = Uri#uri{scheme=Proto, opts=[{<<"transport">>, Sc}|Opts]},
  +            do_parse_urls(Proto, Transports, Rest, [Uri2|Acc]);
  +        false ->
  +            error
  +    end.
  +
  +
  +
  
positive.code:     Uri2 = resolve_scheme(Uri, Opts),
      #uri{
          scheme = Scheme,
          domain = Host, 
          path = Path, 
          ext_opts = UriOpts, 
  
negative.code: -export([get_listening/2, get_listening/3, is_local/1, is_local/2, is_local_ip/1]).
  -export([pid/1, get_nkport/1, get_local/1, get_remote/1, get_remote_bin/1, get_local_bin/1]).
  -export([get_meta/1, get_user/1]).
  -export([resolve/1, resolve/2, multi_resolve/1, multi_resolve/2, parse_urls/3]).
  
  -export_type([listen_id/0, class/0, transport/0, protocol/0, nkport/0, netspec/0]).
  -export_type([listener_opts/0, connect_opts/0, send_opts/0, resolve_opts/0]).
  