HOP server settings
== Description ==
These server parameters give global information on the running HOP.
== Synopsis ==
=== server ===
(hop-use-proxy)
(hop-use-proxy-set! arg)
(hop-uptime)
(hop-verbose)
(hop-verbose-set! arg)
(hop-session)
(hop-session-set! arg)
(hop-realm)
(hop-realm-set! arg)
(hop-charset)
(hop-charset-set! arg)
(hop-locale)
(hop-locale-set! arg)
(hop-xml-backend)
(hop-xml-backend-set! arg)
(hop-service-base)
(hop-enable-proxy-sniffer)
(hop-enable-proxy-sniffer-set! arg)
(hop-proxy-sniffer)
(hop-proxy-sniffer-set! proc)
(hop-proxy-sniffer-add! proc)
(hop-hz-repositories)
(hop-hz-repositories-set!)
(hop-hz-repositories-add!)
== Server Definitions ==
=== ++hop-use-proxy++ ===
hop-use-proxy
hop-use-proxy-set!
This parameter specifies a remote proxy HOP should used for remote
connections. This proxy setting is useful for caching remote requests
or when HOP is located behind a firewall that can only be traversed by
some nodes of the local network.
=== ++hop-uptime++ ===
hop-uptime
^ access ^ type ^ current value ^ short description ^
| r | date | ++,(hop-uptime)++ | The running HOP up time. |
=== ++hop-verbose++ ===
hop-verbose
hop-verbose-set!
^ access ^ type ^ current value ^ short description ^
| r/w | integer | ++,(hop-verbose)++ | The verbosity. |
=== ++hop-session++ ===
hop-session
hop-session-set!
^ access ^ type ^ current value ^ short description ^
| r/w | integer | ++,(hop-session)++ | The current session identifier. |
=== ++hop-realm++ ===
hop-realm
hop-realm-set!
^ access ^ type ^ current value ^ short description ^
| r/w | string | ++,(hop-realm)++ | The current realm. |
=== ++hop-charset++ ===
hop-charset
hop-charset-set!
^ access ^ type ^ current value ^ short description ^
| r/w | symbol | ++,(hop-charset)++ | The default character encoding. |
This parameter controls the default character encoding used by XML
server responses. The currently supported value for the character encoding
are:
* ++ISO-LATIN-1++
* ++ISO-8859-1++
* ++ISO-8859-2++
* ++ISO-8859-15++
* ++WINDOWS-1252++
* ++UTF-8++
* ++UCS-2++
When HOP reads source files, it automatically encodes texts (i.e., ++[...]++
expressions) into the the ++(hop-charset)++.
=== ++hop-locale++ ===
hop-locale
hop-locale-set!
^ access ^ type ^ current value ^ short description ^
| r/w | symbol | ++,(hop-locale)++ | The default character encoding. |
This parameter controls the default character encoding used by server
locale resources (files on the disc and internal character
strings). That is, when a file is read from the server disc, character
strings are converted from the character set specified by
++hop-locale++ into the character set specified by ++hop-charset++.
The currently supported value for the character encoding are:
* ++ISO-LATIN-1++
* ++ISO-8859-1++
* ++ISO-8859-2++
* ++ISO-8859-15++
* ++WINDOWS-1252++
* ++UTF-8++
* ++UCS-2++
=== ++hop-xml-backend++ ===
hop-xml-backend
hop-xml-backend-set!
^ access ^ type ^ current value ^ short description ^
| r/w | xml-backend or symbol | ++,(with-access::xml-backend (hop-xml-backend) (id) id)++ | The default xml-backend. |
This parameter controls the default XML backend used when compiling
Hop elements trees. These elements trees can either be compiled
to ++HTML 4.01++ and ++XML 1.0++.
The argument sent to ++hop-xml-backend-set!++ can either be
a symbol or an instance of the ::xml-backend class. In case of
a symbol it should be one of:
* ++html++, ++html-4.01++
* ++xhtml++, ++xhmlt-1.0++
=== ++hop-service-base++ ===
hop-service-base
The base name for services URL (see ++define-service++).
=== ++hop-enable-proxy-sniffer++ ===
hop-enable-proxy-sniffer
hop-enable-proxy-sniffer-set!
^ access ^ type ^ current value ^ short description ^
| r/w | bool | ++,(hop-enable-proxy-sniffer)++ | Enables/disables proxy sniffing. |
This parameter enables or disables //proxy sniffing//. Proxy sniffing consist
it letting user action to be executed when proxy request are served. This,
for instance, can be used to store on a local cache a copy of the material
transmitted to clients.
=== ++hop-proxy-sniffer++ ===
hop-proxy-sniffer
hop-proxy-sniffer-set!
hop-proxy-sniffer-add!
^ access ^ type ^ current value ^ short description ^
| r/w | procedure | _ | The current proxy sniffer. |
When //proxy sniffing// is enabled (see ++hop-enable-proxy-sniffer++)
each time a proxy request is handled, HOP invokes the function
contained by ++hop-proxy-sniffer++, passing as parameter, a
request descriptor (++http-request++). If this call returns an
output port, then all the characters composing the content of the proxy
request are also written to that port (note that the characters of
the header are not transmitted). When the transfer completes, the sniffer
output port is closed by HOP.
~~ The function ++hop-proxy-sniffer-set!++ sets the new sniffing procedure
(a procedure that is excepted to return an output port). The function
++hop-proxy-sniffer-add!++ //composes// sniffers. That is, it takes as
parameter a new sniffer procedure and it returns an output port that
manages to send the characters of the proxy request body to **all** the
ports returned by previous sniffers.
(hop-proxy-sniffer-add!
(lambda (req::http-request)
(when (string=? req.host "foo.org")
(open-output-file "/tmp/FOO"))))
(hop-proxy-sniffer-add!
(lambda (req::http-request)
(when (string-suffix? ".mp3" req.path)
(open-output-file (format "/tmp/MP3/~a" (basename req.path))))))
~~ See ,( "Proxy hacking" "03-proxy.wiki") for a full example
of proxy sniffing.
=== ++hop-hz-repositories++ ===
hop-hz-repositories
hop-hz-repositories-set!
hop-hz-repositories-add!
^ access ^ type ^ current value ^ short description ^
| r/w | procedure | _ | The list of repositories. |
The parameter ++hop-hz-repositories++ contains the list of
repositories to be scanned when a weblet is search either to be loaded
of imported by a module. They weblet name may use wildcard such as:
(module cdf10-en
~(import (osm-api_server "osm-api-1.0.*.hz"))
~(import (osm-api_client "osm-api-1.0.*.hz"))
~(import (hopslide_client "hopslide-2.3.*.hz"))
(import (geocoder-api_server "geocoder-api-1.0.*.hz")))
~~ In general the ++hop-hz-repositories++ contains a list of local server
directories. In can be set several times. Example:
(hop-hz-repositories-add! "/usr/local/hop/weblets")
(hop-hz-repositories-add! "/opt/hop/weblets")
== See also ==
proxy, charset, ISO-LATIN, UTF-8, UCS-2