Skip to content

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

Closed
danielgustafsson wants to merge 1 commit intocurl:masterfrom
danielgustafsson:dg-pr2320_takeover
Closed

hostip: Add the option of specifying * as host for --resolve#3406
danielgustafsson wants to merge 1 commit intocurl:masterfrom
danielgustafsson:dg-pr2320_takeover

Conversation

@danielgustafsson
Copy link
Member

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

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

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments