Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostip: Add the option of specifying * as host for --resolve #3406

Closed

Conversation

Projects
None yet
3 participants
@danielgustafsson
Copy link
Member

commented Dec 24, 2018

This is a rebased and fixed up version of #2320 which has gone stale. This fully replaces the original PR

This adds support for wildcard hosts in CURLOPT_RESOLVE. These are try-last so any non-wildcard entry is resolved first. If specified, any host not matched by another CURLOPT_RESOLVE config will use this as fallback.

Example send a.com to 10.0.0.1 and everything else to 10.0.0.2:

curl --resolve *:443:10.0.0.2 --resolve a.com:443:10.0.0.1 https://a.com https://b.com

This is probably quite similar to using:

--connect-to a.com:443:10.0.0.1:443 --connect-to :443:10.0.0.2:443

Closes #xxxx

hostip: support wildcard hosts
This adds support for wildcard hosts in CURLOPT_RESOLVE. These are
try-last so any non-wildcard entry is resolved first. If specified,
any host not matched by another CURLOPT_RESOLVE config will use this
as fallback.

Example send a.com to 10.0.0.1 and everything else to 10.0.0.2:
  curl --resolve *:443:10.0.0.2 --resolve a.com:443:10.0.0.1 \
       https://a.com https://b.com

This is probably quite similar to using:
  --connect-to a.com:443:10.0.0.1:443 --connect-to :443:10.0.0.2:443

Closes #xxxx
@bagder

bagder approved these changes Dec 25, 2018

@@ -11,6 +11,10 @@ the number used for the specific protocol the host will be used for. It means
you need several entries if you want to provide address for the same host but
different ports.

By specifying '*' as host you can tell curl to resolve any host and specific
port pair to the specified address. Wildcard is resolved last so any --resolve
with a specific host and port will be used first.

This comment has been minimized.

Copy link
@bagder

bagder Dec 25, 2018

Member

I think it would be good to mention the version number where the wildcard support is added.

This comment has been minimized.

Copy link
@danielgustafsson

danielgustafsson Dec 27, 2018

Author Member

Good point, done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.