frontend_net
Prev | Reference | Next

## Name

frontend_net — Metaproxy Network Server module that accepts Z39.50 and HTTP requests

## DESCRIPTION

This is a frontend module. Listens on one or more ports and sends HTTP/Z39.50 messages to other filters.

## CONFIGURATION

Element `port` is a repeating element (1 or more). The text content specifies a listening port. A few attributes may be given for each port element. Attribute `route` specifies the route to use for the port. Attribute `max_recv_bytes` specifies maximum package size that YAZ should accept (it calls cs_set_max_recv_bytes function of YAZ).

Element `threads` is an optional element. The text content specifies the number of worker threads for the following filters to use. The default value is 5 (5 worker threads).

Element `max-threads` is an optional element. The text content specifies maximum number of worker threads for the following filters to use. By default the thread count is fixed. By using this setting with a higher value than the threads setting, extra worker threads will be added as necessary.

Element `stack-size` is an optional element. The text content specifies stack size in kilobytes for worker threads. If omitted, the system default stack size for threads is used.

Element `timeout` is an optional repeatable element. The text content is treated as an integer that specifies the session timeout in seconds for a client session (using the frontend net filter). The default value is 300 (5 minutes). The element may be repeated and an IP pattern may be given for each element.

Element `connect-max` is an optional repeatable element. The text content is treated as an integer that specifies the maximum number of accepted TCP sessions from the same IP within a minute. A value of 0 means unlimited (no limit). The attribute `ip` specifies an IP-pattern to match. If the IP pattern is matched, the limit takes effect. By repeating this element with different IP patterns, limits may be configured "per-IP". If no patterns are matched, no limit takes place. The IP pattern is a glob pattern. Blanks in a pattern may be used to provide alternatives. For example: `ip="::1 127*"` would match `::1` or `127.0.0.1` , but not `128.0.0.1`.

Element `connect-total` is an optional repeatable element. The text content is treated as an integer that specifies the maximum number of TCP sessions from the same IP. Otherwise similar `connect-max`.

Element `http-req-max` is an optional repeatable element. The text content is treated as an integer that specifies maximum number of accepted HTTP requests from the same original IP. A value of 0 means unlimited (no limit). The attribute `ip` specifies an IP-pattern to match. If the IP pattern is matched, the limit takes effect. By repeating this element with different IP patterns, limits may be configured "per-IP". If no patterns are matched, no limit takes place. The IP pattern is a glob pattern. Blanks in a pattern may be used to provide alternatives.

Element `message` is an optional element. If given and non-empty, logging is performed by the frontend_net filter (to the log file as given by option -l).

Element `stat-req` is an optional element. It specifies a URL path that triggers a report to be generated by the frontend_net filter. By default this report is disabled (same as empty value). The value itself is the path and should be prefixed with a slash. For example `/fn_stat`.

## SCHEMA

# Metaproxy XML config file schemas
#
# Copyright (C) Index Data
# See the LICENSE file for details.
namespace mp = "http://indexdata.com/metaproxy"
filter_frontend_net =
attribute type { "frontend_net" },
attribute id { xsd:NCName }?,
attribute name { xsd:NCName }?,
element mp:threads { xsd:integer }?,
element mp:max-threads { xsd:integer }?,
element mp:stack-size { xsd:integer }?,
element mp:port {
attribute route { xsd:NCName }?,
attribute max_recv_bytes { xsd:integer }?,
attribute port { xsd:integer }?,
attribute cert_fname { xsd:string }?,
xsd:string
}+,
element mp:timeout {
attribute ip { xsd:string }?,
attribute verbose { xsd:integer }?,
xsd:integer
}*,
element mp:connect-max {
attribute ip { xsd:string }?,
attribute verbose { xsd:integer }?,
xsd:integer
}*,
element mp:connect-total {
attribute ip { xsd:string }?,
attribute verbose { xsd:integer }?,
xsd:integer
}*,
element mp:http-req-max {
attribute ip { xsd:string }?,
attribute verbose { xsd:integer }?,
xsd:integer
}*,
element mp:message { xsd:string }?,
element mp:stat-req { xsd:string }?

## EXAMPLES

A typical configuration looks like this:

        <filter type="frontend_net">
         <threads>10</threads>
         <port>@:9000</port>
         <connect-max>100</connect-max>
         <!-- allow many HTTP requests from localhost -->
         <http-req-max ip="::1 127.*">10000</http-req-max>
         <!-- fewer for outsiders -->
         <http-req-max>100</http-req-max>
         <message>FN</message>
         <stat-req>/fn_stat</stat-req>
        </filter>

## SEE ALSO

metaproxy(1)

## COPYRIGHT

Copyright (C) 2005-2020 Index Data

Prev | Up | Next
cql_rpn | Home | http_client