0

I'm working on this project that uses proxy server and curl in c and i cant find a good tutorial that teaches me how to. Can you please help me?? i need an example code that shows the use of a proxy server to connect to google.com. maybe using the CURLOPT_PROXY option.. Thanks in advance.

1 Answer 1

3

Well all you do is your normal curl retrieval, but just set the proxy server option.

   curl_easy_setopt(handle, CURLOPT_PROXY, "127.0.0.1:96666");

EDIT

  /* create headers */
  struct curl_slist *headers=NULL;
  headers = curl_slist_append(headers, "Content-Type: text/xml");

  /* pass our list of custom made headers */
  curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);
Sign up to request clarification or add additional context in comments.

1 Comment

thanx.. but what if i needed to add some extra http headers to the request before sending them??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.