curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: control connections

From: Name via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 20 Dec 2018 10:09:00 +0300

What strategy to use, to control connections for a large amount q,
through curl_multi?

q...qN by A connection proxy1 -> host1
q...qK by B connection proxy1 -> host1

On Wed, Dec 19, 2018 at 5:11 PM Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Wed, 19 Dec 2018, Name via curl-library wrote:
>
> > how to send requests via 2 isolated connections through 1 proxy to one host?
> > example: host: example.com
> > proxy: 127.0.0.1:9050
> >
> > easy1 = curl_easy_create + CURLOPT_PROXY 9050..
> > easy2 = curl_easy_create + CURLOPT_PROXY 9050..
> > ...
> > multi_add_handle( ... easy1, easy)
> >
> > how i pass requests q1, q2 by connection of easy1, and q3,q4 by
> > connection easy2 ?
> > can i use for this task:
> >
> > CURLOPT_FRESH_CONNECT + curl_easy_reset
>
> Yes you can, if you for example do q1, q2 and then set CURLOPT_FRESH_CONNECT
> on q3 (and remove it again for q4).
>
> You can also set CURLOPT_FORBID_REUSE on q2 which will prevent anything else
> from using that connection.
>
> --
>
> / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-12-20