Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear Friends,

How to fetch http proxy IP address and port number using C++ and C language in Windows.

Please can anyone help me on this issue.


Thanks,
S Shanmuga Raja

What I have tried:

I tried out some of the MSDN - Microsoft example. But it is not work out for my problem.
Posted
Updated 20-Nov-16 21:38pm
Comments
gvsk 20-Feb-18 11:20am    
@shanmuga sir, I want to contact you regarding a concept you have posted long back..can you please provide your mail or just drop me a mail @ sundeepgorantla95@gmail.com

1 solution

See WinHttpGetDefaultProxyConfiguration function (Windows)[^].

Alternatively read the registry key that contains the Windows HTTP proxy settings. The key is
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\

and the value is stored as text in ProxyServer (source: How to configure client proxy server settings by using a registry file[^]).

Note that some applications (usually all browsers) allow setting their own proxy rather than using the one configured for the system. Then you have to read the configuration for those applications.
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 21-Nov-16 3:47am    
5ed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900