“In computer networks, a proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers.” From Wikipedia. This can be useful for a company to force its employees to use a proxy (to filter where they surf, to cache the web content for speed issues, to keep machines on the network anonymous, etc.). This post will look at 3 ways to get the proxy definition for a Windows XP machine in order to use that information in another program. It may work in other Windows-type operating systems.
The first one is to use the command line tool
proxycfg but this is different from the one that may be used by Internet Explorer, see here. On my corporate PC, there is no proxy defined this way. But there is one defined in Internet Explorer.
So, in Internet Explorer, to see the proxy connection, you go in the “Tools” menu -> “Internet Options” -> “Connections” tab. And then click on the “LAN settings” button. But this can be blocked by your PC administrator (it’s my case) so let’s look at the other options.
Another option is to use the Firefox (if your company allows you to use it): in the “Tools” menu -> “Options” -> “Advanced” tab -> “Network” tab, in the box named “Connection”, click on the “Settings” button. Then:
- You have no luck if the settings are auto-detected.
- If the option “No proxy” is chosen, your company doesn’t use a proxy.
- If the option “Use system proxy settings” is chosen, you should have seen the proxy with the command line tool proxycfg above.
- If the option “Manual proxy configuration” is chosen, you can directly read the parameters.
- If the option “Automatix proxy configuration URL” is chosen, you can copy-paste the link given in the text field in the address bar to see how Firefox will determine which proxy to use. This page is just a bit of code that tells Firefox in which conditions it should use what proxy. You can find some details here or elsewhere on the web. You have to use the value just after the string “
PROXY“. For instance, your proxy is “
LOCATIONPROXY01” if your proxy string is “
PROXY LOCATIONPROXY01“. If there are many proxy definitions, you have to try to understand the logic behind the .pac file if you want to be sure to find the correct one. Or you can try all of them (brute-force) and you’ll find the one that works.