1

Initially I tried to get the source of the URL and and extract the values which I was looking for the URL as given below

Dim URL = http://www.google.com
Dim oHTTP : Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
  oHTTP.setproxy 2,"<Proxy server:Port>"
  oHTTP.Open "GET", URL, False
  oHTTP.Send

And since the values which I am looking in the URL are proxy specific. And the values vary based the proxy server name which give explicitily as mentioned the above snippet. I realised that giving proxy server name explicitlly is not the right approach since PAC file are used. Giving the proxy name only lists down the servers under that name.

So I thought opening a URL from browser such that it takes the PAC details in account and then draw out the neccessry values from there.

And opening a URL from the default browser is achieved as given below, I wanted to know is there a way extract the values from the browser.

CreateObject("WScript.Shell").Run("http://www.google.com")
ramp
  • 185
  • 7
  • [Maybe related](http://stackoverflow.com/a/1042918/1630171). – Ansgar Wiechers Aug 30 '16 at 08:09
  • There are two thing which were discussed in the redirected article. a. To use `proxycfg.exe`, When checked for this in system32 I could not find it. And at the same time since I have to write this vbscript targeting some machine in the infrastructure it is quiet difficult to acheive this. b.To use `setproxy` or `setproxycredential` properties of `MSXML2.ServerXMLHTTP.6.0`which I have already tried and I am able to achieve my logic. As explained above I have scenario in which PAC file is used to decide the proxy server in which this idea of using setproxy which is failing. – ramp Aug 30 '16 at 11:02
  • Not sure I understand. Are you saying that when you open a website, you want to see what proxy from the PAC was used? What values are you trying to extract? – Randy Schuman Aug 31 '16 at 04:32
  • @RandySchuman Partially correct. Let me make it clear I want to open a website as you said and when this is happening the PAC file will decide which proxy server to use. And coming to the actual point what I am looking to get is the proxy details which is used while connecting to the website which I want to open. And when I say Proxy details I want to extract the Proxy Server name, Proxy IP address and Port and Client IP . Hope I made it clear. – ramp Aug 31 '16 at 05:18
  • I was not able to find a way to pull this info from the brower. Try typing "netsh winhttp show proxy" at the command line with your website open. More information - http://stackoverflow.com/questions/4933677/detecting-windows-ie-proxy-setting-using-java http://superuser.com/questions/33588/how-to-view-internet-explorer-auto-detected-proxy-settings http://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using/346376#346376 http://stackoverflow.com/questions/3068728/how-to-discover-de-proxy-used-in-a-pac – Randy Schuman Aug 31 '16 at 05:54

0 Answers0