yazproxy
8
yazproxy
The YAZ toolkit's transparent Z39.50 proxy
yazproxy
-a filename
-l filename
-m num
-v level
-t target
-U auth
-o level
-i seconds
-T seconds
-p pidfile
-u userid
-c config
host:port
DESCRIPTION
yazproxy is a Z39.50 optimizing proxy daemon.
The listening port must be specified on the command-line.
inetd operation is not supported.
The host:port
argument specifies host address to listen to, and the port to
listen on. Use the host @
to listen for connections coming from any address.
yazproxy can be configured using command-line
options or a configuration file.
Configuration file options override values specified
on the command-line.
yazproxy rereads its configuration file and
reopens log files when it receives the hangup signal, SIGHUP.
OPTIONS
-a filename
Specifies the name of a file to which to write a log of the
APDUs (protocol packets) that pass through the proxy. The
special filename - may be used to indicate
standard output.
-l filename
Specifies the name of a file to which to write a log of the
YAZ proxy activity. This uses the logging facility as provided
by the YAZ toolkit. If this options is omitted, the output
directed to stderr.
-m num
Specifies the maximum number of connections to be cached
[default 50].
-v level
Sets the logging level. level is
a comma-separated list of members of the set
{fatal,debug,warn,log,malloc,all,none}.
-t target
Specifies the default backend target to use when a client
connects that does not explicitly specify a target in its
initRequest.
-U auth
Specifies authentication info to be sent to the backend target.
This is useful if you happen to have an internal target that
requires authentication, or if the client software does not allow
you to set it.
-o level
Sets level for optimization. Use zero to disable; non-zero
to enable. Handling for this is not fully implemented;
we will probably use a bit mask to enable/disable specific
features. By default optimization is enabled (value 1).
-i seconds
Specifies in seconds the idle time for communication between
client and proxy. If a connection is inactive for this long
it will be closed. Default: 600 seconds (10 minutes).
-T seconds
Specifies in seconds the idle time for communication between
proxy and backend target.
If a connection is inactive for this long
it will be closed. Default: 600 seconds (10 minutes).
-p pidfile
When specified, yazproxy will create pidfile
with the process ID of the proxy. The pidfile will be generated
before the process changes identity (see option -u).
-u userid
When specified, yazproxy will change identity to the user ID
specified, just after the proxy has started listening to a
possibly privileged port and after the PID file has been created
if specified by option -u.
-c config
Specifies config filename. Configuration is in XML
and is only supported if the YAZ proxy is compiled with
libxml2.
EXAMPLES
The following command starts the proxy, listening on port
9000, with its default backend target set to the Library of
Congress bibliographic server:
$ yazproxy -t z3950.loc.gov:7090 @:9000
The LOC target is sometimes very slow. You can connect to
it using yaz-client as follows:
$ yaz-client localhost:9000/voyager
Connecting...Ok.
Sent initrequest.
Connection accepted by target.
ID : 34
Name : Voyager LMS - Z39.50 Server
Version: 1.13
Options: search present
Elapsed: 7.131197
Z> f computer
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 10000
records returned: 0
Elapsed: 6.695174
Z> f computer
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 10000
records returned: 0
Elapsed: 0.001417
In this test, the second search was more than 4000 times faster
than the first, because the proxy cached the result of the first
search and noticed that the second was the same.
The YAZ command-line client,
yaz-client,
allows you to set the proxy address by specifying option -p. In
that case, the actual backend target is specified as part of the
Initialize Request.
Suppose you have a proxy running on localhost,
port 9000 and wish to connect to Index Data's test target at
indexdata.dk:210/gils you could use:
yaz-client -p localhost:9000 indexdata.dk:210/gils
Since port 210 is the default, the port can be omitted:
yaz-client -p localhost:9000 indexdata.dk/gils