Configure web browser (Janus Debugger only)
Set up your web browser to use the Debugger Client as a proxy server. Information follows for these individual browser types:
You need the Janus Proxy port number you determined earlier in the preliminary tasks section. The default port is 8081, but you can change this by editing the debuggerConfig.xml file.
Once you define a proxy server for a browser:
- The Debugger Client must be running in order to operate that browser.
You will need to turn off the proxy in order to use the browser without the Debugger Client. Automatic toggling of the proxy definition is a Client option available for the Chrome and Internet Explorer browsers (only). Otherwise, it may be more convenient to point one browser at the Debugger Client proxy and use a different browser for your other Internet access.
- While you are debugging, you can use a second tab in your browser to access the Internet while another tab is occupied with User Language debugging. Secured (HTTPS) connections are not allowed. The occupied tab, the tab that invoked the Debugger, continues to remain unavailable for the duration of each debugging session.
Note: If it is not possible or not desirable to change the proxy settings on your web browser, an alternative way to debug web threads is to invoke the Debugger from a command you insert in procedures you run on Janus Web threads.
Chrome or Internet Explorer (IE)
The directions that follow describe Debugger Client modifications to the Internet Properties dialog box on the browser workstation, which affects both Chrome and IE Internet connections. Note: These instructions were originally prepared for early Client versions that had no features built into the Client to control the browser. It is now recommended that you:
For more information about the Internet Properties dialog box, see Navigating to and within the Internet Properties dialog box.
Automatically setting and removing the proxy definitionTo invoke the proxy service automatically without having to manually define it each time (Chrome and Internet Explorer only; for other browsers, you must maintain proxy settings manually): 1. Select Preferences from the Debugger Client File menu to display the Preferences dialog box. 2. In the IE Options area, select the proxy option of IE Mode.
3. Click the Done button.
The Client will automatically specify and enforce the proxy definition when the Client is started. When the Client is closed, the Client will restore the proxy settings to their state before the Client was started.
Handling addresses specified to bypass the proxy serverIt is an option of the automatic proxy maintenance to clear and save at Client opening any settings in the "Do not use proxy server for addresses beginning with:" box (accessed this way). The settings for these exceptions are then restored when the Debugger Client is closed (or when the feature is disabled). To enable this feature, you must select both the IE Mode option proxy and the Clear IE proxy override checkbox in the Debugger Client's Preferences dialog box. The feature is off by default. Note: If you do enable this feature, then exception URLs you had specified in the Internet Properties "Do not use proxy server for addresses beginning with:" box will now be routed to and passed through the Debugger when the Client is running. If the feature is not enabled (Clear IE proxy override is not selected), the operating system handles these exception URLs and the Debugger never sees them.
Using the Client as proxy exclusively for designated addressesYou can use the Debugger Client as a proxy server only for requests for the hosts (Onlines) specified in the Debugger configuration file, debuggerConfig.xml. The browser is directed to do this host filtering by a script you create (by Client command or UI checkbox). Once this feature is in effect, the Client will act as a proxy server for requests for hosts specified in the script but for no other browser requests. The JavaScript script (debuggerInternalPac.js) is called a Proxy Auto Config (PAC) file, and it is created by default in the Client work-file folder. If no such work folder is configured, the Client installation folder is used. The Client will automatically:
By default, the Client uses a file mode URL format (file://) to locate the PAC file. The Client can also use an HTTP mode URL format (http://), storing the file on a web server. You select file or HTTP mode from the Client GUI or by Client command, as described below. Note: Caution is recommended when working with PAC files. Errors are not well reported and have the potential to prevent the browser from operating. Be very careful if you edit or create your own PAC files. Here is a good reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file
Client steps to invoke the automatic creation and maintenance of a PAC file
1. Select Preferences from the File menu, and locate the IE Options area. 2. In the IE Mode box, select either newPac or mergedPac:
Both newPac and mergedPac enable the PAC Options button if the following are true (as described in the next section, Setting up an HTTP server for PAC files):
3. Click the PAC Options button to display the PAC Options dialog:
If http, The Client instantly tests an HTTP PUT and GET of a verification file to and from the designated PAC file HTTP server. The Client then displays a Status bar message like the following which reports the result of the test: HTTP PAC files can be used. 4. Click the Done button.
Setting up an HTTP server for PAC filesIf you will be using HTTP to access a PAC file, you must provide an HTTP (Web) server to hold the PAC files, and you must specify that server's location and port in the Client's configuration file. 1. Provide a web server.
begin variables are undefined local subroutine closeFile(%iFile is string len 8 input) * Close the file whose name is passed. %rc is float $resetn('MSGCTL', 6, %rc) $close('FILE ' with %iFile) $resetn('MSGCTL', 0, %rc) end subroutine local function openFile(%iFile is string len 8 input) is float * Open the file whose name is passed and return 0 for success or * non-zero for failure. %rc is float $resetn('MSGCTL', 6, %rc) openc file %iFile $resetn('MSGCTL', 0, %rc) return $status end function * Get and validate the command line argument: port number %args is object stringlist %args = %(system):arguments:unspace:parseLines(', ') %portNumber is float if (%args:count eq 0) then print 'No port number specified' stop elseif (%args:count > 1) then print 'Too many arguments' stop elseif (%args(1) is not like '/2-5(#)') then print 'Invalid port number' stop else %portNumber = %args(1) end if %pacRepo is string len 8 initial('JDPACREP') %worker is object daemon auto new %workForDaemon is object Stringlist auto new * See if memory file for PAC repository is there, if not create it if (%(local):openFile(%pacRepo) eq 0) then printText Memory file {%pacRepo} already present %(local):closeFile(%pacRepo) else printText creating memory file {%pacRepo} text to %workForDaemon = new ALLOCATE {%pacRepo} WITH MEMORY PAGES=300 CREATE {%pacRepo} PARAMETER BSIZE=1, DSIZE=250 END OPENC {%pacRepo} IN {%pacRepo} INITIALIZE CLOSE {%pacRepo} end text %worker:run(%workForDaemon):print end if * Set up a simple Janus web server with web rules for loading * serving and listing PAC files generated by the debugger client. %portName is string len 8 initial('JDPACSRV') * Get rid of any earlier one, so this script can be rerun as needed text to %workForDaemon = new JANUS DRAIN {%portName} JANUS DELETE {%portName} end text %worker:run(%workForDaemon) * Create the server and its rules text to %workForDaemon = new * Create a web server JANUS DEFINE {%portName} {%portNumber} WEBSERV 20 TRACE 7 * Allow PAC file upload via HTTP PUT of URL of format /pacman/xxx.js JANUS WEB {%portName} - ON PUT /PACMAN/*.JS OPEN FILE {%pacRepo} RECV *.JS BASE64 JANUS WEB {%portName} ALLOW PUT /PACMAN/*.JS * Provide HTTP GET access for URLs of format /pacman/xxx.js JANUS WEB {%portName} ON GET /PACMAN/*.JS OPEN FILE {%pacRepo} - SEND *.JS BINARY EXPIRE +0 * Start the web server JANUS START {%portName} end text %worker:run(%workForDaemon):print end Since the PAC files are temporary, they are stored in an in-memory file (not persistent between runs) which does not need any disk files, DD cards, etc. The PAC files are stored as Model 204 procedures. The name of a PAC file procedure created by the Client (see the following sections) is based on the IP number of the Client workstation to avoid conflicts. 2. Update debuggerConfig.xml.
<httpPacURL>http://pacServerHost:pacServerPortNum/pacman</httpPacURL> 3. Restart the Client, or just issue the retryHttpPac command to test your setup.
The following directions are provided primarily for information purposes. They show the controls that the Client modifies automatically for Chrome and IE, as described in the preceding subsections. It is recommended that you not make these modifications manually except for any proxy server bypass addresses. To access the Internet Properties dialog box:
To access the proxy server controls in the Internet Properties dialog box:
To access the proxy server bypass for certain connections:
Note: You can set up the Client to automatically save and restore these addresses. |
Firefox
To set up the proxy for Firefox browsers:
Once defined, the proxy remains in effect whether the Debugger Client is operating or not. |
Lynx
The Lynx character-mode browser is fast and handy for testing. To make it use a proxy, set the environment variable http_proxy to the full URL of the Janus proxy. Here is a Unix shell script example (running on a PC under Cygwin) that sets this variable and runs Lynx: #!/bin/bash http_proxy=http://127.0.0.1:8081 export http_proxy env lynx Note: The http:// is required. Once defined, the proxy remains in effect whether the Debugger Client is operating or not. |
Opera
To set up the proxy:
Once defined, the proxy remains in effect whether the Debugger Client is operating or not. |