curl / Mailing Lists / curl-library / Single Mail


Re: Doubt regarding the use of linux namespaces in Libcurl

From: Dan Fandrich via curl-library <>
Date: Tue, 5 Mar 2019 07:57:20 +0100

On Tue, Mar 05, 2019 at 12:01:29PM +0530, Vipin P R via curl-library wrote:
> Hi,
>     I am looking for a way to bind an easy handle or a multi handle of libcurl
> to a particular linux namespace for every request. Is there some way in libcurl
> to do this internally. If not, can you please guide me how to do this using C
> language. 

You can use the CURLOPT_OPENSOCKETFUNCTION option to set a callback function
that takes care of opening sockets. Each socket can be opened any way the
code desires and then its handle is returned to libcurl.

>>> Dan
Received on 2019-03-05