Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:11:19+00:00 2026-06-11T21:11:19+00:00

In my project i am using libcurl to download data over internet. The problem

  • 0

In my project i am using libcurl to download data over internet. The problem is that libcurl doesn’t detect the proxy settings of the wifi connection.

I must set manually the settings for libcurl so i’m wondering how can a get the proxy settings of a wifi connection. I found some clues about informations in the KeyChain but i was unable to retrieve them.

Do you know if there is a way to get this settings so i can set them for libcurl ?

Thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:11:20+00:00Added an answer on June 11, 2026 at 9:11 pm

    I found the response !

    Using this bit of code seems to work :

    std::string getProxyName()
    {
        CFDictionaryRef dicRef = CFNetworkCopySystemProxySettings();
        const CFStringRef proxyCFstr = (const CFStringRef)CFDictionaryGetValue(dicRef, (const void*)kCFNetworkProxiesHTTPProxy);
        char buffer[4096];
        memset(buffer, 0, 4096);
        if (CFStringGetCString(proxyCFstr, buffer, 4096, kCFStringEncodingUTF8))
        {
            return std::string(buffer);
        }
        return "";
    }
    
    
    int CDownloadThread::getProxyPort()
    {
        CFDictionaryRef dicRef = CFNetworkCopySystemProxySettings();
        const CFNumberRef portCFnum = (const CFNumberRef)CFDictionaryGetValue(dicRef, (const void*)kCFNetworkProxiesHTTPPort);
    
        SInt32 port;
        if (CFNumberGetValue(portCFnum, kCFNumberSInt32Type, &port))
        {
            return port;
        }
        return -1;
    }
    

    I haven’t try with automatic proxy configuration yet but i hope it’s working !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm on a project using CORBA to read the data of objects that could
I have a lein project (using cascalog--but that's not particularly important). I'm trying to
I wanna write a little c++ program using libcurl. It's for a school project
I am doing a project using TranslateAnimation in Android. In that I am translating
I am using libcurl in my project and it depends on openssl and bunch
I have been using libcurl in a C++ project. I have added the libcurl
So I finished a project using DOM to get data. Everything worked great, and
I'm doing a project using core data, and as far as I know anything
I have a winform project using LINQ 2 SQL as data access. I want
I'm using libcurl in a Win32 C++ application. I have the curllib.vcproj project added

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.