anchor.diff:      %% V2
       {['POST', "^/v2/channels/(\\d+)/drains$"], fun(Req, [ChannelIdStr]) ->
           ChannelId = list_to_integer(ChannelIdStr),
  -        case logplex_drain:valid_uri(req_drain_uri(Req)) of
  +        case valid_uri(Req) of
               {error, What} ->
                   Err = io_lib:format("Invalid drain destination: ~p",
                                       [What]),
  
positive.code:     Json = {struct, [{error, <<"Not found">>}]},
      {404, iolist_to_binary(mochijson2:encode(Json))}.
  
  req_drain_uri(Req) ->
      {struct, Data} = mochijson2:decode(Req:recv_body()),
      case proplists:get_value(<<"url">>, Data) of
          undefined ->
  
negative.code:                 undefined ->
                      {error, missing_host_param};
                  Host ->
                       logplex_drain:valid_uri(logplex_tcpsyslog_drain:uri(Host, Port))
              end;
          UrlString ->
              try
                  logplex_drain:valid_uri(
                    logplex_drain:parse_url(UrlString))
              catch
                  error:badarg ->
                      {error, UrlString}
              end            
      end.
  
     
  