0

I'm trying to find a good way to determine if my pc is working behind a proxy or not.

I'm browsing through the WinAPI but cannot find anything useful. I´ve read that it is enough to open a tcp connection on port 80 to an internet address but is this really the best solution?

I don't wanna check the proxy settings of each browser but the global system proxy settings ... if there is something like that.

I have to use Windows (XP and Windows 7 and newer should be supported) and C++

Community
  • 1
  • 1
seveves
  • 1,282
  • 4
  • 17
  • 37
  • 1
    It's not an absolute thing. You may have a proxy for any subset of IP addresses, and possibly more than one. Different browsers may have different proxies. So, explain to your boss that no answer will be 100% correct anyway. – MSalters Jul 09 '13 at 21:53
  • Ok, so I should edit my question ... I'm only interested in the system proxy settings. – seveves Jul 10 '13 at 08:04
  • You mean Internet Explorers settings? Note that in the EU, Windows "N" versions sometimes do not include IE. – MSalters Jul 10 '13 at 12:38

1 Answers1

0

You can use the WinINet API, see "Setting and Retrieving Internet Options" here:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa385384%28v=vs.85%29.aspx#general_option

This assumes the proxy setting is set in Internet Explorer options.

PowerApp101
  • 1,798
  • 1
  • 18
  • 25
  • That's probably not a good fix, for some reason at my university IE runs without a proxy, whereas for example Firefox needs one. I wouldn't have a proxy set on IE. – Adrian Jandl Jul 09 '13 at 14:42
  • @AdrianJandl I don't think that's possible. The difference is that the university has set things up so that IE automatically uses the proxy, where as it's up to you to set up Firefox. – James Kanze Jul 09 '13 at 15:14
  • @JamesKanze: IE may run via MS ISA server acting as a firewall or NAT. – MSalters Jul 09 '13 at 22:01