anchor.diff:          refresh_fun => fun((nkport()) -> boolean()),   % Will be called on timeout
           base_nkport => boolean()| nkport(), % Select (or disables auto) base NkPort
           valid_schemes => [nklib:scheme()],  % Fail if not valid protocol (for URIs)
  +        force_scheme => nklib:scheme(),     % Allow using ws://...
           debug => boolean(),
   
           % TCP/TLS/WS/WSS options
  
positive.code:     {ok, [raw_connection()], map()} |
      {error, term()}.
  
  resolve(#uri{scheme=Scheme}=Uri, Opts) ->
      #uri{domain=Host, path=Path, ext_opts=UriOpts, ext_headers=Headers} = Uri,
      UriOpts1 = [{nklib_parse:unquote(K), nklib_parse:unquote(V)} || {K, V} <- UriOpts],
      UriOpts2 = case Host of
          <<"0.0.0.0">> -> UriOpts1;
  
negative.code: 
  
  %% @private
  resolve_scheme(#uri{scheme=Sc, opts=UriOpts}=Uri, Opts) ->
      case maps:find(force_scheme, Opts) of
          {ok, Sc} ->
              Uri;
          {ok, Forced} when Sc==tcp; Sc==tls; Sc==ws; Sc==wss; Sc==http; Sc==https ->
              Uri#uri{scheme=Forced, opts=[{<<"transport">>, Sc}|UriOpts]};
          error ->
              Uri
      end.
  
  
  %% @private
  -spec multi_resolve(nklib:user_uri()|[nklib:user_uri()]) -> 
      {ok, [{[raw_connection()], map()}]} |
      {error, term()}.
  