Similar to this post, I'd like to change my proxy settings using a script. However, it fails. When I am behind the proxy, IE does not connect to the internet. Here I try the first solution from craig:
function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "myactualip", "myactualsubnetip"))
return "PROXY proxyasshowninpicture:portihavetouseforthisproxy_see_picture";
else
return "DIRECT";
}
This script is saved as proxy.pac in c:\windows and my configuration is* in LAN settings:
No automatically detected settings,
yes, use automatic config script: file://c:/windows/proxy.pac
No proxy server.
So, what am I doing wrong?
—————- update ————–
However, when I set up a proxy in my LAN configurations:
IE -> Internet Options -> Connections -> LAN Settings
check: Use a proxy Server for your LAN
Address: <a pingable proxy> Port: <portnr>
everything is fine for this environment. Now I try a simpler script like
function FindProxyForURL(url, host)
{
return "PROXY <pingable proxy>:<portnr>; DIRECT";
}
With a configuration described above** I am not able to get through the proxy.
Best Answer
Finally this page lead me to my solution:
There are some temporary registry hacks given, but I was not able to get my scripts to work with regedits. Finally I set up a local IIS server
and moved my *.pac javascript file with the content
into inetpub\wwwroot.
Afterwards I checked "Use automatic configuration script" in IE -> Internet Options -> Connections -> LAN Settings. Use the \inetpub\wwwroot\scriptFilename.