curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: control connections

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 19 Dec 2018 15:11:06 +0100 (CET)

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-19