peterh
peterh

Reputation: 19304

Windows: reading network proxy settings programmatically

I need to read Windows' network proxy settings programmatically exactly as they are set in the UI. (the devil is in the latter part of that sentence)

I'm fully aware of the Win32 WinHttpGetIEProxyConfigForCurrentUser function and on surface it is exactly what I want but it masks the results of the autoDetect attribute always returning false (at least on Win7) if WPAD fails. Admittedly this is clever, but it is not what I want. For my purpose I need to know what the UI setting is, not a value that has been "resolved" by Windows.

How can I retrieve network proxy configuration (as specified in the UI) in a reliable way across Windows versions since Win 7 ?

Upvotes: 0

Views: 795

Answers (1)

milevyo
milevyo

Reputation: 2184

from registry:

[HCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
ProxyServer=xxx.xxx.xxx.xxx:yyyy (REG_SZ)
ProxyEnable= (REG_DWORD)

Upvotes: 1

Related Questions