GeneratePac command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "__TOC__ {| |width="50%"| '''Action:''' |width="50%"| <span class="f_ListBul1">Generates a PAC (Proxy Auto Config) JavaScript file from the Debugger configuration settings in...")
 
No edit summary
Line 4: Line 4:
|width="50%"| '''Action:'''
|width="50%"| '''Action:'''
|width="50%"|
|width="50%"|
<span class="f_ListBul1">Generates a PAC (Proxy Auto Config) JavaScript file from the Debugger configuration settings in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">. If this file is defined to the Internet Explorer browser, IE </span><span class="f_ListBul1">will use the Debugger Client as a proxy </span><span class="f_EmphItal">only</span><span class="f_ListBul1"> for requests for the hosts (Onlines) [[customize_debugger_cfg_file.html#hostserverlist|specified]] in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">. </span>
<span class="f_ListBul1">Generates a PAC (Proxy Auto Config) JavaScript file from the Debugger configuration settings in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">. If this file is defined to the Internet Explorer browser, IE </span><span class="f_ListBul1">will use the Debugger Client as a proxy </span>''only''<span class="f_ListBul1"> for requests for the hosts (Onlines) [[Customize debuggerConfig file#Basic configuration steps |specified]] in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">. </span>


<span class="f_Para">The IE browser does this host filtering if the PAC file location is specified for it in the </span><span class="f_GUIlabel">Address</span><span class="f_Para"> value in </span><span class="f_GUIlabel">Tools</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Internet options</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Connections</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">LAN settings</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Use automatic configuration script.</span><span class="f_Para"> </span>
<span class="f_Para">The IE browser does this host filtering if the PAC file location is specified for it in the </span><span class="f_GUIlabel">Address</span><span class="f_Para"> value in </span><span class="f_GUIlabel">Tools</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Internet options</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Connections</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">LAN settings</span><span class="f_Para"> &gt; </span><span class="f_GUIlabel">Use automatic configuration script.</span><span class="f_Para"> </span>
Line 14: Line 14:
<p class="syntax">generatePac [''file'' [overwrite|nomerge]] </p>
<p class="syntax">generatePac [''file'' [overwrite|nomerge]] </p>


Where ''file'' is the name of a file which, if not specified, defaults to </span><span class="f_Monospace">debuggerInternalPac.js</span><span class="f_Para">. The generated file is placed by default in the Client [[change_location_client_work.html|workfile folder]]. If no such work folder is configured, the Client installation folder is used. </span>
Where ''file'' is the name of a file which, if not specified, defaults to </span><span class="f_Monospace">debuggerInternalPac.js</span><span class="f_Para">. The generated file is placed by default in the Client [[Changing the location of Client work files|workfile folder]]. If no such work folder is configured, the Client installation folder is used. </span>


If you specify a ''file'' value:  
If you specify a ''file'' value:  
Line 27: Line 27:
'''Note:''' If your ''file'' specification contains an error (typo, incorrect file or path name, etc.), the Internet Explorer browser ignores the command and does not inform you of the error</span><span class="f_Notes">. </span>
'''Note:''' If your ''file'' specification contains an error (typo, incorrect file or path name, etc.), the Internet Explorer browser ignores the command and does not inform you of the error</span><span class="f_Notes">. </span>


When ''generatePac'' runs, it reports its activity in the Debugger Client [[using_macro_console_cmdline.html|console]]. For example:  
When ''generatePac'' runs, it reports its activity in the Debugger Client [[Using the console and command line|console]]. For example:  


<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Command: generatePac foo.js overwrite</span><br />
<p class="syntax"><span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Command: generatePac foo.js overwrite</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Generated New Pac file: foo.js</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Generated New Pac file: foo.js</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Added: 5 web servers from the configuration.</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">Added: 5 web servers from the configuration.</span><br />
Line 51: Line 51:
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">   if (isDebuggable) return &quot;PROXY 127.0.0.1:8081;DIRECT&quot;;</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">   if (isDebuggable) return &quot;PROXY 127.0.0.1:8081;DIRECT&quot;;</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">   return &quot;DIRECT&quot;;</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">   return &quot;DIRECT&quot;;</span><br />
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">} </span>
<span style="font-size: 12px; font-family: 'Courier New',Courier,monospace;">} </span></p>


<span class="f_Para">The quoted host URLs above are copied from the </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para"> file. The last of them (with no explicit port number appended) is generated when a port 80 specification is present in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">.  </span>
<span class="f_Para">The quoted host URLs above are copied from the </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para"> file. The last of them (with no explicit port number appended) is generated when a port 80 specification is present in </span><span class="f_Monospace">debuggerConfig.xml</span><span class="f_Para">.  </span>

Revision as of 02:25, 1 December 2022

Action:

Generates a PAC (Proxy Auto Config) JavaScript file from the Debugger configuration settings in debuggerConfig.xml. If this file is defined to the Internet Explorer browser, IE will use the Debugger Client as a proxy only for requests for the hosts (Onlines) specified in debuggerConfig.xml.

The IE browser does this host filtering if the PAC file location is specified for it in the Address value in Tools > Internet options > Connections > LAN settings > Use automatic configuration script.

By default, generatePac merges the code it generates with that of an existing PAC file (if such a file is already specified in the Internet Explorer configuration options).  

Syntax:

generatePac [file [overwrite|nomerge]] 

Where file is the name of a file which, if not specified, defaults to debuggerInternalPac.js. The generated file is placed by default in the Client workfile folder. If no such work folder is configured, the Client installation folder is used.

If you specify a file value:

  • You can use quotation marks to indicate an absolute or relative Windows file system path:  
    • If quoted (for example, generatePac "c:\pac\debuggerPac.js"), the file value is treated as an absolute file path.  
    • If not quoted (for example, generatePac foo.js), the value is treated as a path relative to the workfile folder.
  • You can also use a file URL (for example, file://c:\xxx\yyy.js ) to specify the file.

If a file with the same name as file already exists, it will not be overwritten, unless you specify overwrite. If you use overwrite, the file value must be explicitly specified.

Note: If your file specification contains an error (typo, incorrect file or path name, etc.), the Internet Explorer browser ignores the command and does not inform you of the error.

When generatePac runs, it reports its activity in the Debugger Client console. For example:  

Command: generatePac foo.js overwrite
Generated New Pac file: foo.js
Added: 5 web servers from the configuration.
Generated Pac File:
// foo.js generated by debugger client on: 2013 05 23 15:59:20
function FindProxyForURL(url, host) {
   urlLc = url.toLowerCase();
   isDebuggable = (
      (shExpMatch(urlLc, "http://sirius-software.com:3666/*%22)
         ||
      (shExpMatch(urlLc, "http://sirius-software.com:9219/*%22))
         ||
      (shExpMatch(urlLc, "http://sirius-software.com:3667/*%22)
         ||
      (shExpMatch(urlLc, "http://sirius-software.com:3000/*%22)
         ||
      (shExpMatch(urlLc, "http://sirius-software.com:80/*%22)
         ||
      (shExpMatch(urlLc, "http://sirius-software.com/*%22)
   );
   if (isDebuggable) return "PROXY 127.0.0.1:8081;DIRECT";
   return "DIRECT";

The quoted host URLs above are copied from the debuggerConfig.xml file. The last of them (with no explicit port number appended) is generated when a port 80 specification is present in debuggerConfig.xml.  

See also the setIEMode command, which combines the generatePac functionality with automatic specification and removal of the PAC file in the IE configuration settings when the Client starts and closes.

Client menu: --
Introduced: Build 62