Demonstrate getting Proxy settings from a windows service
Some PCs are connected to the internet through proxy
There are global settings (LAN setting) and settings per connection device (VPN, cellular dongle etc).
Settings can be manually controlled with the Connections tab in Internet Properties wizard ([login to view URL])
Browsers sometimes can control their proxy settings for themselves (all except IE and Edge do that) - we are not addressing these in this project.
Proxy settings include: proxy server address, server port, and authentication (via username/password or a certificate)
In the beginning of time proxy settings were plain in the registry, or through WinHttpGetIEProxyConfigForCurrentUser()
Then the registry became encrypted and as of windows 2000 we have InternetQueryOption()
If you are not familiar with most of the above already this project is not for you, please try not to waste my time and yours.
Now, a normal user application can use those API calls to get the proxy settings and talk to the internet.
But we want a solution for services not user applications.
Services are those processes that are run automatically and controlled via [login to view URL]
In particular we are talking about services that run as the SYSTEM user.
Microsoft seems to break InternetQueryOption() for services, and WinHttpGetIEProxyConfigForCurrentUser() is a very limited subset of the options available and in 2018 it's pretty useless.
So what can a service author do? Hire a freelancer of course!
The deliverable of this project is a snippet of code that:
1) Runs inside a SYSTEM user service. To verify it works you'll need to build a skeleton windows service project.
2) Gets the relevant proxy settings while run as a service using the local system account.
3) You don't have to actually connect to the proxy. All we need to get the settings: server address, port, and authentication information.
4) You only need to get the windows device and LAN settings - browsers specific settings are not part of this project.