curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Resolution of host name before checking against no_proxy env variable

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 7 Dec 2018 11:56:54 +0100 (CET)

On Fri, 7 Dec 2018, Piotr Dobrogost wrote:

> It seems curl checks host name – given as a parameter on the command line –
> against no_proxy environment variable without doing name resolution first.
> Is this the case?

Yes, since the filter is for the actually provided host name.

> If so could it also check against resolved domain name?

Sure, it's all just code so certainly that would be possible, but I'd say it
would require an extra flag to trigger such a changed behavior. Plus the fact
that curl currently never reverse-lookup addresses so it'd be quite a lot of
new functionality/code. And a bit of a weird situation/setup, since when a
proxy is used a client normally does not resolve the host name at all but this
suggested way it would have to wait for the resolving of the target host name
to complete first before it can continue to contact the proxy...

> As it is now there's no way to skip http proxy for all single-label host
> names by setting no_proxy=.local.domain.suffix as to curl all single-label
> host names are not related in any way.

Right, you'd probably need to explicitly list the exact host names.

An alternative way could be to support some magic string in no_proxy that
means host-name-without-dot.

-- 
  / daniel.haxx.se

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-12-07