Discussion:
Resolution of host name before checking against no_proxy env variable
Piotr Dobrogost
2018-12-07 09:09:35 UTC
Permalink
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?
If so could it also check against resolved domain name?
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.

Regards,
Piotr Dobrogost
Daniel Stenberg
2018-12-07 10:56:54 UTC
Permalink
Post by Piotr Dobrogost
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.
Post by Piotr Dobrogost
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...
Post by Piotr Dobrogost
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
Loading...