Como posso depurar o PAC (proxy auto config) no Windows 8.1 (IE11 e Modern UI)?

12

Em sistemas mais antigos, como o Windows 7 + IE10, chamar "alert ()" no arquivo PAC faria com que uma caixa de diálogo fosse mostrada. No entanto, com o Windows 8.1, nenhum diálogo é exibido, mesmo se o IE11 estiver usando o PAC.

Minha situação atual é IE11 pode usar os proxies (SOCKS) (retornados pelo PAC) muito bem, mas aplicativos de interface do usuário modernos são completamente desconectados da Internet. Parece IE11 e Modern UI tratar a configuração do PAC de forma diferente, mas não consigo encontrar uma maneira de depurá-lo.

Em resumo, minhas perguntas são

  1. Como depurar o PAC com IE11 no Windows 8.1?
  2. Como depurar o PAC com Modern UI no Windows 8.1?
por Jackie Ku 26.05.2014 / 09:36

1 resposta

3

Alterações no arquivo PAC do IE11

Houve mudanças feitas pela Microsoft em como o IE11 lida com arquivos PAC locais. Você pode ler sobre eles aqui ou veja abaixo algumas informações rápidas.

Observe também que alert() declarações não funcionam mais no Windows 8.

With IE11, the usage of a PAC-file through the file-protocol is no more possible, unless you add the following registry-key:

[HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings]
(DWORD)"EnableLegacyAutoProxyFeatures"=1

Note:alert-statementswillnomoreappearwhenusingWindows8orhigher!

ArquivoDEBUGPACcomAUTOPROX( Link para Download )

Sometimes you need just to test your PAC-file, if the expected route is returned, although you have no access to the website in question. For such testing you can use the (attached) command line-utility tool autoprox.exe, created by Pierre-Louis Coll.

When starting it in a CMD without additional parameter the usage is displayed:

C:\temp>autoprox
Version : 2.1.0.0
Written by [email protected]
Usage : AUTOPROX -s  (calling DetectAutoProxyUrl and saving wpad.dat file in temporary file)
Usage : AUTOPROX  [-h] url [Path to autoproxy file]
       -h: calls InternetInitializeAutoProxyDll with helper functions implemented in AUTOPROX
AUTOPROX url: calling DetectAutoProxyUrl and using WPAD.DAT logic to find the proxy for the url
AUTOPROX url path: using the autoproxy file from the path to find proxy for the url
Example: autoprox -s
Example: autoprox http://www.microsoft.com
Example: autoprox -h http://www.microsoft.com c:\inetpub\wwwroot\wpad.dat
Example: autoprox http://www.microsoft.com http://proxy/wpad.dat

Here is the output with our sample:

C:\temp>autoprox http://us.msn.com c:\temp\sample.pac
The Winsock 2.2 dll was found okay
url: http://us.msn.com
autoproxy file path is : c:\temp\sample.pac
Calling InternetInitializeAutoProxyDll with c:\temp\sample.pac
        Calling InternetGetProxyInfo with url http://us.msn.com and host us.msn.com
        Proxy returned for url http://us.msn.com is:
PROXY myproxy:80;

When you want to see which DNS-related functions have been called, you can use the parameter “-h” in addition: Here the output, when this is used:

C:\temp>autoprox -h http://us.msn.com c:\temp\sample.pac
The Winsock 2.2 dll was found okay
Will call InternetInitializeAutoProxyDll with helper functions
url: http://us.msn.com
autoproxy file path is : c:\temp\sample.pac
Calling InternetInitializeAutoProxyDll with c:\temp\sample.pac
        Calling InternetGetProxyInfo with url http://us.msn.com and host us.msn.com
ResolveHostByName called with lpszHostName: us.msn.com
ResolveHostByName returning lpszIPAddress: 65.55.206.229
        Proxy returned for url http://us.msn.com is:
PROXY myproxy:80;

Error-Handling in autoprox.exe:

  1. When you specify a non-existing PAC-file (e.g. typo in the command-line), the result from autoprox.exe will be:

    ERROR: InternetInitializeAutoProxyDll failed with error number 0x6 6.

  2. When the Pac-file contains syntax-errors, you typically receive the following message displayed:

    ERROR: InternetGetProxyInfo failed with error number 0x3eb 1003.

After finishing the local test, the PAC-file should be copied to the webserver where it will be accessed through http-protocol.

    
por 08.10.2015 / 16:25