+ <section id="proxy-config-file">
+ <title>Proxy Configuration File</title>
+ <para>
+ The Proxy as an option may read a configuration file using option
+ <literal>-c</literal> followed by the filename of a config file.
+ </para>
+ <para>
+ The config file is in XML format. The YAZ proxy must be compiled
+ with <ulink url="http://www.xmlsoft.org/">libxml2</ulink> support in
+ order for the config file facility to be enabled.
+ </para>
+ <tip>
+ <para>To check for a config file to be well-formed, the yaz-proxy may
+ be invoked without specifying a listening port, i.e.
+ <screen>
+ yaz-proxy -c myconfig.xml
+ </screen>
+ If this does not produce errors, the file is well-formed.
+ </para>
+ </tip>
+ <section id="proxy-config-header">
+ <title>Proxy Configuration Header</title>
+ <para>
+ The proxy config file must have a root element called
+ <literal>proxy</literal>. All information except an optional XML
+ header must be stored within the <literal>proxy</literal> element.
+ </para>
+ <screen>
+ <?xml version="1.0"?>
+ <!-- $Id -->
+ <proxy>
+ <!-- content here .. -->
+ </proxy>
+ </screen>
+ </section>
+ <section id="proxy-config-target">
+ <title>Configuration: target</title>
+ <para>
+ The element <literal>target</literal> which may be repeated zero
+ or more times with parent elemtn <literal>proxy</literal> contains
+ information about each backend target.
+ The <literal>target</literal> element have two attributes:
+ <literal>name</literal> which holds the logical name of the backend
+ target (required) and <literal>default</literal> (optional) which
+ (when given) specifies that the backend target is the default target -
+ equivalent to command line option <literal>-t</literal>.
+ </para>
+ <para>
+ <screen>
+ <?xml version="1.0"?>
+ <!-- $Id -->
+ <proxy>
+ <target name="server1" default="1">
+ <!-- description of server1 .. -->
+ </target>
+ <target name="server2">
+ <!-- description of server2 .. -->
+ </target>
+ </proxy>
+ </screen>
+ </para>
+ </section>
+ <section id="proxy-config-url">
+ <title>Configuration:url</title>
+ <para>
+ The <literal>url</literal> which may be repeated one or more times
+ should be the child of the <literal>target</literal> element.
+ The CDATA of <literal>url</literal> is the Z-URL of the backend.
+ </para>
+ <para>
+ Multiple <literal>url</literal> element may be used. In that case, then
+ a client initiates a session, the proxy chooses the URL with the lowest
+ number of active sessions, thereby distributing the load. It is
+ assumed that each URL represents the same database (data).
+ </para>
+ </section>
+ <section id="proxy-config-keepalive">
+ <title>Configuration: keepalive</title>
+ <para>The <literal>keepalive</literal> element holds information about
+ the keepalive Z39.50 sessions. Keepalive sessions are proxy-to-backend
+ sessions that is no longer associated with a client session.
+ </para>
+ <para>The <literal>keepalive</literal> element which is the child of
+ the <literal>target</literal>holds two elements:
+ <literal>bandwidth</literal> and <literal>pdu</literal>.
+ The <literal>bandwidth</literal> is the maximum total bytes
+ transferred to/from the target. If a target session exceeds this
+ amount it is shut down (and no longer kept alive).
+ The <literal>pdu</literal> is the maximum number of requests sent
+ to the target. If a target session exceeds this amount it is
+ shut down. The idea of these two limits is that avoid very long
+ sessions that eat resources in a backend (that leaks!).
+ </para>
+ </section>
+ <section id="proxy-config-limit">
+ <title>Configuration:limit</title>
+ <para>
+ The <literal>limit</literal> section specifies bandwidth/pdu requests
+ limits for an active session.
+ The proxy records bandwidth/pdu requests during the last 60 seconds
+ (1 minute). The <literal>limit</literal> may include the
+ elements <literal>bandwidth</literal>, <literal>pdu</literal>,
+ and <literal>retrieve</literal>. The <literal>bandwidth</literal>
+ measures the number of bytes transferred within the last minute.
+ The <literal>pdu</literal> is the number of requests in the last
+ minute. The <literal>retrieve</literal> holds the maximum records to
+ be retrived in one Present Request.
+ </para>
+ <para>
+ If a bandwidth/pdu limit is reached the proxy will postpone the
+ requests to the target and wait one or more seconds. The idea of the
+ limit is to ensure that clients that downloads hundreds or thousands of
+ records do not hurt other users.
+ </para>
+ </section>
+
+ <section id="proxy-config-attribute">
+ <title>Configuration: attribute</title>
+ <para>
+ The <literal>attribute</literal> element specifies accept or reject
+ or a particular attribute type, value pair.
+ </para>
+ <para>
+ The <literal>attribute</literal> has two required attributes:
+ <literal>type</literal> which is the Attribute Type-1 type, and
+ <literal>value</literal> which is the Attribute Type-1 value.
+ </para>
+ <para>
+ If attribute <literal>error</literal> is given, that holds a
+ Bib-1 diagnostic which is sent to the client if the particular
+ type, value is part of a query.
+ </para>
+ <para>
+ If attribute <literal>error</literal> is not given, the attribute
+ type, value is accepted and passed to the backend target.
+ </para>
+ </section>
+
+ <section id="proxy-config-syntax">
+ <title>Configuration: syntax</title>
+ <para>
+ The <literal>syntax</literal> element specifies accept or reject
+ or a particular record syntax request from the client.
+ </para>
+ <para>
+ The <literal>syntax</literal> has one equired attribute:
+ <literal>type</literal> which is the Preferred Record Syntax.
+ </para>
+ <para>
+ If attribute <literal>error</literal> is given, that holds a
+ Bib-1 diagnostic which is sent to the client if the particular
+ record syntax is part of a present - or search request.
+ </para>
+ <para>
+ If attribute <literal>error</literal> is not given, the record syntax
+ is accepted and passed to the backend target.
+ </para>
+ <para>
+ If attribute <literal>marcxml</literal> is given, the proxy will
+ perform MARC21 to MARCXML conversion. In this case the
+ <literal>type</literal> should be XML. The proxy will use
+ preferred record syntax USMARC/MARC21 against the backend target.
+ </para>
+ <para>To accept USMARC and offer MARCXML XML recors but reject
+ all other requests the following configuaration could be used:
+ <screen>
+ <proxy>
+ <target name="mytarget">
+ <syntax type="usmarc"/>
+ <syntax type="xml" marcxml="1"/>
+ <syntax type="*" error="238"/>
+ </target>
+ </proxy>
+ </screen>
+ </para>
+ </section>
+
+ <section id="proxy-config-target-timeout">
+ <title>Configuration: target-timeout</title>
+ <para>
+ The element <literal>target-timeout</literal> is the child of element
+ <literal>target</literal> and specifies the amount in seconds before
+ a target session is shut down.
+ </para>
+ </section>
+
+ <section id="proxy-config-client-timeout">
+ <title>Configuration: client-timeout</title>
+ <para>
+ The element <literal>client-timeout</literal> is the child of element
+ <literal>target</literal> and specifies the amount in seconds before
+ a client session is shut down.
+ </para>
+ </section>
+
+ <section id="proxy-config-preinit">
+ <title>Configuration: preinit</title>
+ <para>
+ The element <literal>preinit</literal> is the child of element
+ <literal>target</literal> and specifies the number of spare
+ connection to a target. By default no spare connection are
+ created by the proxy. If the proxy uses a target exclusive or
+ a lot, the preinit session will ensure that target sessions
+ have been made before the client makes a connection and will therefore
+ reduce the connect-init handshake dramatically. Never set this to
+ more than 5.
+ </para>
+ </section>
+
+ <section id="proxy-config-max-clients">
+ <title>Configuration: max-clients</title>
+ <para>
+ The element <literal>max-clients</literal> is the child of element
+ <literal>proxy</literal> and specifies the total number of
+ allowed connections to targets (all targets). If this limit
+ is reached the proxy will close the least recently used connection.
+ </para>
+ </section>
+
+ </section>