Initializes the RexxInet functions, and tells them how to connect to the network.
Synopsis
error = InetOpen(flags, access, scriptName, proxyName, proxyBypass)
Args
flags specifies some options. It may be any of the following:
Value | Meaning |
---|---|
ASYNC | Make only asynchronous requests when reading/writing data. |
OFFLINE | Do not connect to the internet. Instead, go into "offline mode" and use the cache. |
If omitted, flags defaults to none of the above.
access tells RexxINet how to connect to the internet (and perhaps where to get needed information about such). It can be one of the following values:
Value | Meaning |
---|---|
PRECONFIG | Use registry configuration to connect to the server of the user's internet provider. The registry must already be setup with that server information, for example, as a result of configuring Internet Explorer. |
DIRECT | Use a direct connection to a local network. Note: If using RexxINet to connect to a local, TCP/IP network, then you'll likely skip InetAutodial(). |
PROXY | Connect via a CERN proxy to access the internet. A CERN proxy is a Web server that acts as a gateway and can forward HTTP requests to the intended server. |
NO_AUTOPROXY | Use registry configuration to find a server, and also prevent using java/script/INS config scripts. |
If omitted, access defaults to "PRECONFIG".
scriptName is some string that RexxInet uses (perhaps in a dialog box that may need to be presented to the user) to identify your script. This can be any string of your choosing but typically will be the name of your script (ie, not necessarily the filename, but whatever you call your software such as "REXX Internet Tool").
If omitted, scriptName defaults to the name of your script, or REXX object variable, that calls InetOpen().
proxyName is passed only if access is PROXY or DIRECT. In this case, proxyName is a string containing the name/port number of each CERN proxy server. See below for details.
proxyBypass is passed only if access is PROXY, and specifies any host names or IP addresses, or both, that should not be routed through the proxy.
Returns
An empty string if successful, or an error message if a failure.
Notes
RexxINet supports only CERN type proxies (HTTP only) and the TIS FTP gateway (FTP only). If Microsoft Internet Explorer is installed, RexxINet also supports SOCKS proxies.
Note: FTP and Gopher requests can be made through a CERN proxy either by changing the request to an HTTP request or by using InetOpenUrl.
To specify a proxy for a specific protocol, your proxyName arg must be formatted as:
protocol=protocol://server_name:port_numberThe valid protocols are HTTP, HTTPS, FTP, and Gopher. For example, to specify an FTP proxy, a valid string could be:
ftp=ftp://MyFtpServerName:21...where MyFtpServerName is the name of the FTP proxy server, and 21 is the port number used to access the server.
If the server uses the default port number for that protocol, the port number can be omitted. For example, since port 21 is the default for FTP, then the following string is identical:
ftp=ftp://MyFtpServerNameYou can specify more than one server, including different servers for the different protocols. You must separate each server name by a space. For example, if you specify:
ftp=ftp://someftpserver gopher=http://gophername:99... then FTP requests are made through the proxy server named someftpserver which listens at default port 21, and Gopher requests are made through a CERN proxy named gophername which listens at port 99.
If a server name is specified by itself, it is used as the default server for any protocols for which you haven't specified a particular server. For example:
http=http://MyHttpServer MyOtherServer...would use the server named MyHttpServer for any HTTP operations, while all other protocols would use the server named MyOtherServer.
As another example:
ftp=ftp://someftpserver gopher=http://gophername:99 defaultserver...FTP requests are made through the server named someftpserver, and Gopher requests are made through gophername. All other requests (for example, HTTP requests) are made through the CERN proxy named defaultserver, which listens at port 80.
If your script uses only one protocol, for example doing only FTP operations, then you can simply supply the server name. For example:
ftp=ftp://someftpserver...can be shortened to simply:
someftpserver
Host names or IP addresses that are known locally can be specified in your proxyBypass arg. This string can contain wildcards, "*", which bypass the proxy server for addresses that fit the specified pattern. To specify multiple addresses and host names, separate each with blank space. If <local> is specified, then any host name that does not contain a period is bypassed.
The following example shows sample calls to InetOpen using different proxy bypass strings. The comments above each call describe what effect the bypass string has on the host names that are accessed.
/* Bypass the proxy for any host name that doesn't contain a period. */ InetOpen(, 'PROXY', , "proxy", "<local>") /* Bypass the proxy for any host name that starts with the letters "ms". */ InetOpen(, 'PROXY', , "proxy", "ms*") /* Bypass the proxy for any host name that contains "int", such as "internet" and "painter". */ InetOpen(, 'PROXY', , "proxy", "*int*") /* Bypass the proxy for the host name "example" and any host name that contains "test" */ InetOpen(, 'PROXY', , "proxy", "example *test*")