In addition, you should probably read the Information via the Web and Using Elvis as a Web browser sections of the Tips chapter. You may also wish to read the "html" section of the Display Modes chapter.
URLs have the form
where the components of the URL have the following meanings:
You can append a "#name" to the end of the URL. After loading the URL, Elvis searches through its text for a <a name=name> tag -- even if the file isn't an HTML file.
You can also append a "?expression" to the end of an URL. The expression's meaning depends on the protocol. For "file:" and "buffer:", it is used as an ex line address (usually a line number or a regular expression), and the cursor will be moved to that line. This is used by the :browse command. For "http:", it is passed to the server and usually interpreted by a program residing there. For other protocols it has no meaning, and should not be used.
While in the "html" display mode,
tag names are assumed to be URLs too.
However, if a tag name lacks the protocol, site, port, or directory name
then it inherits those properties from the current document.
This is true only for tags, and only if you're in the
"html" display mode.
For example, if you're viewing "ftp://ftp.cs.pdx.edu/pub/elvis/README.html",
and then give the command "
then Elvis will load the URL "ftp://ftp.cs.pdx.edu/pub/elvis/Announce.21d".
Elvis always uses FTP's non-paged binary data format. Many files require this, and most other files will can be converted manually later if necessary.
If possible, when Elvis is downloading a file via FTP it will display the file's size along with the number of bytes downloaded so far, so you can gauge how much longer the download will take. However, not all FTP servers support the "SIZE" command that Elvis uses to learn the file's size, so sometimes Elvis can't display the file's size while downloading. Also, Elvis never displays the size of a directory while downloading.
Elvis converts FTP directory listings into HTML documents. For each file or subdirectory, Elvis constructs a hypertext link from the directory to the file/subdirectory, so you can browse through an FTP file system using Elvis' "html" display mode.
In addition to reading, Elvis allows you to write via FTP. You can even append to a remote file via FTP, with a command such as...
Unfortunately, the FTP protocol doesn't have a well-defined means for testing the attributes of a file. I tried to make Elvis clever enough to infer the file type from the limited information that the FTP server can provide, but in some cases it may fail.
Since Elvis is an editor (not merely a browser), it has different requirements. You may wish to fetch a private file from your own account at some FTP site, modify it, and write it back again. You can't do that with anonymous FTP; Elvis must therefore support user-specific FTP in addition to anonymous FTP.
To remain compatible with the Web, Elvis normally uses anonymous FTP. If you want to access an FTP server using your own account, Elvis requires you to give a directory name which begins with a "~". For example, "ftp://localhost/pub/myfile" refers to "pub/myfile" in the anonymous directory hierarchy, but "ftp://localhost/~/myfile" refers to "myfile" in your home directory using your own account's privileges. You can also put a user name after the tilde to access some other user's account, as in "ftp://localhost/~bob/bobsfile".
Elvis doesn't prompt for your password when you access an FTP site using a non-anonymous account, though. Instead, it searches for account information in the ".netrc" file in your home directory, or if that doesn't exist then it searches for "elvis.ftp" anywhere in your elvispath. Regardless of the name, the file has the exact same format.
The file is divided into words. Some of these are keywords; others are data associated with the preceding keywords. Line breaks are no more significant than any other whitespace, but for the sake of readability it is a good idea to keep all data for a particular FTP site on a single line. To describe multiple accounts on a single FTP site, I suggest you put each account on a separate line.
A typical line will have a format like this...
machine server.domain.name login yourlogin password yourpass...where server.domain.name is the name of an FTP server, yourlogin is your login name there, and yourpass is your unencrypted password.
Warning! Because this file contains unencrypted passwords, you must be very careful to make this file unreadable by other users.
For more information about the ~/.netrc file, look in the Unix manual at the ftp(1) and netrc(5) man-pages. Elvis' use of the ~/.netrc file is intended to be compatible with ftp's use of that file.
The first entry for a given FTP site is assumed to be your own account; it is used for accessing URLs which begin with a tilde but have no user name. For other accounts (with the user name after the tilde), Elvis looks for the first entry in which the machine and user fields both match the values from the URL. This is a slight extension of ~/.netrc's traditional meaning.
Elvis supports HTTP. In fact, Elvis requires you to configure HTTP support if you want FTP support; you can't have FTP without HTTP.
Elvis doesn't support authentication or security. Authentication would embed your user name and password into each request you make; this would be useful for accessing subscription sites for things like stock market information, or an online encyclopedia. Security would encrypt each request; this would be useful when the request contains sensitive information such as your credit card number. Since Elvis doesn't support these features, it can't replace a real Web browser.
HTTP is a read-only protocol. Consequently, you can't write to an "http:" URL.
The first reason is to get around a firewall. For security reasons, many Local Area Networks are configured to severely restrict the flow of data between the LAN and the Internet. This prevents you from accessing an Internet site directly. A proxy server may straddle that firewall, so it can receive requests from computers on the LAN, and send requests to Internet sites.
The second reason is that the URL you send to an HTTP proxy doesn't necessarily have to be an "http:" URL. It could use Gopher, WAIS, or whatever. Elvis can thus use its built-in HTTP support, and the services of an HTTP proxy, to support any protocol which the proxy supports.
elvis.netconfiguration file tells Elvis which requests must go through a proxy, and which can be sent directly. When a proxy is needed, it also gives the name of the proxy.
The file is divided into words. The word "direct" means that following words are domain names which can be accessed directly (without a proxy). The word "proxy" is followed by the name of an HTTP proxy server, and then by the names of domains which must use that proxy.
The domain names in this file can either be the complete names of servers ("www.othersite.com"), or a partial name which starts with a dot (".othersite.com") which matches all sites whose name has the same ending.
When Elvis wants to read from a URL,
it scans through the file and uses the first "proxy" or "direct" list
which mentions the URL's domain.
If the domain doesn't appear in any of list,
then the last "proxy" or "direct" list is used;
i.e., the last "proxy" or "direct" command is used as the default.
As a simple example, if all requests must go through a proxy,
elvis.net would contain:
When Elvis is given a URL that uses any protocol
other than "ftp:" or "http:" it searches through the
for a proxy using the usual rules,
except that if the URL's domain isn't mentioned in any list,
then Elvis will use the last proxy mentioned in the file
(even if there is a "direct" list after that).
If there is no proxy, then Elvis gives an error message.
For example, if you can access all sites directly,
but also have access to a proxy which can fetch non-ftp/http URLs for you,
then Elvis.net should look like this:
proxy www.myproxy.com direct
As a final example, here's a file which causes all accesses to sites whose domain name ends with ".mylan.com" to be accessed directly, but all other sites accessed via a proxy. This is a typical set-up for a proxy which is used to reach out through a firewall.
direct .mylan.com proxy www.myproxy.com
Note that all proxy accesses use the HTTP protocol, even if they are to FTP sites. This means that you can only read through a proxy; you can't write through a proxy because HTTP is a read-only protocol.
The proxy accesses work by sending an HTTP "GET" request to the HTTP server, passing it the whole URL rather than just the directory and filename. The server must then be clever enough to parse the URL, and fetch the requested document from the proper site, using the proper protocol. Not all servers are that smart, so don't be surprised if your closest server can't handle proxy requests.
elvis.net doesn't exist, then all FTP or HTTP accesses will be
direct, and other protocols will generate an error.
The same behavior can also be generated by creating an
file containing only the word "direct".