curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Custom resolve of Address

From: Rainer Canavan via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 22 Nov 2021 13:50:32 +0100

On Mon, Nov 22, 2021 at 1:33 PM Marcel via curl-library
<curl-library_at_lists.haxx.se> wrote:
>
> Hey everyone,
>
> I'm in need of a callback, that let me resolve a domain to an IP address.

[...]

> how to intercept the c-ares query, e.g. by using a callback in that library which then will resolve a name to a IP address.

You can always override function calls by re-routing them into your
own dynamic library before passing it on to the original - at least on
Linux and similar systems.

You can skip the LD_PRELOAD if you're linking your own program. The
examples below should be sufficient to get you started with this:

https://www.linuxjournal.com/article/7795

https://hackerboss.com/overriding-system-functions-for-fun-and-profit/

rainer
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-11-22