226

I need to know what the address for my proxy server is so I can configure another program to also use it. If I go into IE, Internet Properties, LAN Settings, then all I see is an automatic configuration script but not the actual proxy address. How can I get this?

I'm using Windows XP.

1

15 Answers 15

233

The auto proxy detection system works by downloading a file called wpad.dat from the host wpad. First confirm this host exists from a command prompt:

ping wpad

If it doesn't exist, you may have to put the correct DNS suffix. In the same command prompt, type

ipconfig /all

You should see a Primary DNS Suffix and a DNS Suffix Search List

Try appending each of these with a . to wpad:

ping wpad.<primary dns suffix>

If any of these work, then in your browser enter http://wpad.<suffix>/wpad.dat. This will download the proxy auto configuration file you can open in notepad.exe

Toward the bottom of this file, you should see a line saying

PROXY <host:port>;

It might be repeated if you have multiple proxies available. The host and port are what you need.

If this file doesn't exist, then either there is no proxy server, or the proxy server is being provided by dhcp (note that this would only work with IE, so if firefox can surf, this is not the method being used). If you don't have access to the dhcp server to see what it is sending, the easiest way would be to open a site in ie, then go to a command prompt. Type

netstat -ban

This will provide a list of connections made with the process id of each process. Go to Task Manager, and select View/Select Columns and enable PID (Process Identifier). Look for the PID of iexplore.exe in the list returned by netstat -ban This will reveal the proxy ip and port.

9
  • 4
    To download the automatic configuration script I find it is easier to just copy and paste the link to the script into the address bar (YMMV)…
    – mousio
    Oct 17, 2011 at 21:30
  • 2
    Yea the problem with that is the domain policy prevents that from being changed, and IE disables the box for the URL. It won't let you copy it or see the entire thing heh. Oct 30, 2011 at 19:03
  • 3
    Instead of wpad.dat, my proxy configuration apparently uses a "proxy.pac" file that appears in the "use automatic configuration script" section of the LAN settings. This is a script which determines a proxy server to use.
    – Ben
    Jun 15, 2015 at 17:59
  • 1
    @Ben Hi Ben, that is right, this answer focuses on auto detection, rather than auto configuration. You are welcome to enhance the answer.
    – Paul
    Jun 15, 2015 at 21:31
  • 2
    Did not work for me on Windows 10 Jul 24, 2018 at 14:18
91

See edit below.

I have one more easy way to find it. Install chrome and go to below URL to see the proxy details

 chrome://net-internals/#proxy

You will be able to see all the details

EDIT September 2020

As stated in the comment by @RMorrisey, you can use the following link (Chrome 85.x.x.x)

chrome://net-export/
9
  • 1
    This has a lot more information! Thanks for sharing.
    – Shiyaz
    Apr 26, 2017 at 9:52
  • 2
    This method is very useful when you work with VPN but want to know your network proxy protocol type IP and port.Thanks.
    – zionpi
    Jun 24, 2017 at 14:14
  • 15
    Unfortunately, this no longer works; it appears Google has removed the functionality. (I'm on version 73 of Chrome, but I don't know when it was removed -- this isn't something I use every day.)
    – David
    Apr 3, 2019 at 16:35
  • 12
    For me, this screen in Chrome is almost totally blank. May 7, 2019 at 12:08
  • 4
    This feature is now replaced by: chrome://net-export/
    – RMorrisey
    Aug 28, 2020 at 15:58
78

Try the following command in cmd:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"

Hope helps

5
  • 20
    In my case, I had to find "AutoConfigURL" instead of "proxyserver". This led me to a *.pac file which I could read through to find the default proxy returned by the script.
    – Ben
    Jun 15, 2015 at 17:57
  • For me, this was the only answer that showed me my actual proxy address. The others tended to show me where to find a script, which I would have to hand-parse to understand which rules applied to me. Apr 18, 2018 at 10:55
  • Only thing that worked so far.
    – saran3h
    Jun 24, 2020 at 19:40
  • This worked for me, I got the auto config URL, downloaded the PAC file and read proxy config
    – camposer
    Aug 19, 2020 at 11:34
  • This one is so beautifully solved my problem Nov 14, 2023 at 6:26
38

The following command also seems to work. As a bonus it avoids contacting lots of DNS servers that might or might not work, and it avoids querying the registry, so it functions even in fairly locked-down environments:

Windows Vista or later:

netsh winhttp show proxy

Windows XP or earlier:

netsh diag connect ieproxy

Some additional work is required to extract the proxy address from the output, so the registry approach is simpler if you know it's going to be available.

Update:

I've found that on windows 7 netsh sometimes returns different results depending on how I call it. If I run the above command manually in a prompt, I get 'Direct Access - No Proxy'. However, calling netsh from SAS results in an actual proxy being listed!

12
  • 6
    sais: Direct access <no proxy server>. but i definetly am behind a proxy .. only shows WinHTTP Proxys
    – philx_x
    Mar 20, 2015 at 13:11
  • 6
    I'm seeing the "Direct Access" line also. What did you mean by "calling netsh rom SAS"?
    – Ben
    Jun 15, 2015 at 17:36
  • 3
    netsh winhttp show proxy shows system proxy settings (Default user). A user may have different settings.
    – xmedeko
    Dec 8, 2015 at 9:19
  • 8
    I'm definitely behind a proxy and when I call netsh command I get: "Direct access (no proxy server).". What is SAS?
    – iaforek
    Oct 18, 2016 at 21:37
  • 3
    What do you mean by "SAS"? Sep 7, 2018 at 18:51
20

You can also get the automatic configuration file URL from the registry by running:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Wpad" /s | find /i "WpadDetectedURL"
1
  • 2
    This returns empty string for me WpadDetectedUrl REG_SZ
    – Mache
    Nov 13, 2019 at 10:53
13

If you are using an auto-detect proxy settings then do in the address bar of you browser (no matter which one you have installed)

http://wpad/wpad.dat

Then you will get a javascript file describing which proxy server is used according to what are you trying to visit on the network...

2
  • Although the url didn't work, +1 for linking to the Microsoft documentation
    – GoGoris
    Jul 10, 2017 at 11:00
  • This is the simplest solution and worked nicely for me. The proxy server is contained in the line which says something similar to return "PROXY myproxy.com:8080".
    – Tobias
    Jul 14, 2023 at 9:21
11

use the below website to get your proxy : http://www.whatismyproxy.com/

2
  • 2
    This solution identified for me that my seemingly direct access to the web was actually being routed through a McAfee web gateway Mar 23, 2017 at 12:52
  • This is a nice web page but it does not reveal the proxy port, so it is not useful (at least for me).
    – Tobias
    Jul 14, 2023 at 9:24
4

I have created a simple WinProxyViewer.exe to show Windows proxy settings. It's purpose is that a common user is able to run it and send the output to the admin (tech. support, etc.).

4

Related to Nimble Fungus's Answer, as Nimble's answer no longer work in recent versions of Chrome. The following works in the Google Chrome Version 83.0.4103.116 (Official Build) (64-bit) (Released 2020-05-19)

Go on Google Chrome, go to this link chrome://net-export/ in the browser.

Click on 'Start Logging to Disk', choose a place to store the log file. Now on a new tab, go to a random website (I went to google.com in my case). Then go back to the chrome://net-export/ tab, and click 'Stop Logging'. Click 'Show File'.

Open up that file, search for the key word "proxy_server", that variable will tell you the proxy server plus port number that you are using to connect to the internet.

2

To learn lots and lots about your current internet connection and set-up, including the proxy server you are using at the moment, go to the following address in Chrome:

chrome://net-internals/

You'll see a column on the left-hand side of the page which gives you a list of different types of information you can request, among them "proxy."

NOTE: it's perfectly possible to add the "chrome:" URI scheme to windows, so that you can get this information by going to "chrome://net-internals/" from ANY browser, not just chrome. But since the handler for this URI scheme needs to be chrome, you need to have chrome installed in any case. Adding the URI scheme "chrome" to your registry is therefore only really useful if you use a different browser and want to avoid the clicks/typing required to first bring up chrome (and thence to go to chrome://net-internals/)

1
2

Not a perfect solution but worked for me when needed quick lookup in corporate network. NetStat in cmd lists current connections. IP with port 8080 or 9090 is most likely the proxy.

2

Just to clear up some confusion about proxies in windows that i had when reading all kind of blogs and answers on stack overflow:

  • There are 2 different proxy settings: WinHTTP and WinINET
  • Depending on your use case you have to check/set WinHTTP or WinINET

WinINET

  • used by Browsers and many other applications
  • e.g. Fiddler uses this to read the network traffic
  • configure with
    • internet option window
    • or windows 11 proxy settings / Network & internet > Proxy window
    • or look into the registry at Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings.

WinHTTP

  • used by Windows Services like Windows update and stuff
  • configure with
    • netsh winhttp set/show/reset proxy ....

links:

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 24, 2023 at 12:24
  • yeah, you have to read the other answers and comments here to understand my answer. if you do that and still dont find a solution, my answer can be helpful.
    – Welcor
    Jun 24, 2023 at 15:54
0

Non of the above hints worked for me (working in a big company using Windows 7 Enterprise, "completely closed" for endusers).

I finally found this little Java program, which worked fine for me: https://stackoverflow.com/questions/4933677/detecting-windows-ie-proxy-setting-using-java

0

Put the script path into an ie window and it will either download or open the wpad script - if it downloads it, use notepad to view as it is text based.

WPAD is a logic driven file to sent internet requests to different proxies or direct to the internet depending on a number of factors such as source, destination, IP or url (even parts of the dns name). In some cases it could be quite hard to read depending on how complex the file is - I've seen some beauties, but it is fairly intuitive.

-3

This is what chatgpt talked to me

networksetup -getwebproxy Wi-Fi

and it works

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .